Skip to content

Commit

Permalink
fix: var-naming linter error
Browse files Browse the repository at this point in the history
  • Loading branch information
mhrynenko committed Dec 13, 2024
1 parent 45105f1 commit 7d7c9bd
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion internal/data/pg/verify_users.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (q *VerifyUsersQ) Upsert(VerifyUsers *data.VerifyUsers) (data.VerifyUsers,
"age_lower_bound": VerifyUsers.AgeLowerBound,
"nationality": VerifyUsers.Nationality,
"uniqueness": VerifyUsers.Uniqueness,
"event_id": VerifyUsers.EventId,
"event_id": VerifyUsers.EventID,
"status": VerifyUsers.Status,
"proof": proofJSON,
"sex": VerifyUsers.Sex,
Expand Down
2 changes: 1 addition & 1 deletion internal/data/verify_users.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type VerifyUsers struct {
Nationality string `db:"nationality"`
CreatedAt time.Time `db:"created_at"`
Uniqueness bool `db:"uniqueness"`
EventId string `db:"event_id"`
EventID string `db:"event_id"`
Status string `db:"status"`
Proof []byte `db:"proof"`
Sex string `db:"sex"`
Expand Down
6 changes: 3 additions & 3 deletions internal/service/handlers/get_proof_parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func GetProofParameters(w http.ResponseWriter, r *http.Request) {
return
}

if !helpers.Authenticates(AuthClient(r), UserClaims(r), auth.UserGrant(userInputs.UserId)) {
if !helpers.Authenticates(AuthClient(r), UserClaims(r), auth.UserGrant(userInputs.UserID)) {
ape.RenderErr(w, problems.Unauthorized())
return
}
Expand Down Expand Up @@ -55,8 +55,8 @@ func GetProofParameters(w http.ResponseWriter, r *http.Request) {
}

user := &data.VerifyUsers{
UserID: userInputs.UserId,
UserIDHash: helpers.BytesToKeccak256Hash(common.HexToAddress(userInputs.UserId).Bytes()),
UserID: userInputs.UserID,
UserIDHash: helpers.BytesToKeccak256Hash(common.HexToAddress(userInputs.UserID).Bytes()),
CreatedAt: time.Now().UTC(),
Status: "not_verified",
Nationality: userInputs.Nationality,
Expand Down
4 changes: 2 additions & 2 deletions internal/service/handlers/proof_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func GetProofParamsById(w http.ResponseWriter, r *http.Request) {
callbackURL = fmt.Sprintf("%s/integrations/verificator-svc/public/callback/%s", Callback(r).URL, userIDHash)
)

if existingUser.EventId != "" {
eventID = existingUser.EventId
if existingUser.EventID != "" {
eventID = existingUser.EventID
}

if existingUser.AgeLowerBound == -1 {
Expand Down
4 changes: 2 additions & 2 deletions internal/service/handlers/proof_params_light.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func GetProofParamsLightById(w http.ResponseWriter, r *http.Request) {
callbackURL = fmt.Sprintf("%s/integrations/verificator-svc/light/public/callback-sign/%s", Callback(r).URL, userIDHash)
)

if existingUser.EventId != "" {
eventID = existingUser.EventId
if existingUser.EventID != "" {
eventID = existingUser.EventID
}

if existingUser.AgeLowerBound == -1 {
Expand Down
4 changes: 2 additions & 2 deletions internal/service/handlers/verification_callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ func VerificationCallback(w http.ResponseWriter, r *http.Request) {

verifiedUser.Status = "verified"

if verifiedUser.EventId != "" {
eventID = verifiedUser.EventId
if verifiedUser.EventID != "" {
eventID = verifiedUser.EventID
}

if verifiedUser.Uniqueness {
Expand Down
2 changes: 1 addition & 1 deletion internal/service/handlers/verification_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func VerificationLink(w http.ResponseWriter, r *http.Request) {
}

if req.Data.Attributes.EventId != nil && *req.Data.Attributes.EventId != "" {
user.EventId = *req.Data.Attributes.EventId
user.EventID = *req.Data.Attributes.EventId
}

if req.Data.Attributes.AgeLowerBound != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/service/handlers/verification_link_light.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func VerificationLinkLight(w http.ResponseWriter, r *http.Request) {
}

if req.Data.Attributes.EventId != nil && *req.Data.Attributes.EventId != "" {
user.EventId = *req.Data.Attributes.EventId
user.EventID = *req.Data.Attributes.EventId
}

if req.Data.Attributes.AgeLowerBound != nil {
Expand Down
6 changes: 3 additions & 3 deletions internal/service/requests/get_proof_parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

type UserInputs struct {
UserId string `url:"user_id"`
UserID string `url:"user_id"`
AgeLowerBound int `url:"age_lower_bound"`
Uniqueness bool `url:"uniqueness"`
Nationality string `url:"nationality"`
Expand All @@ -25,10 +25,10 @@ func NewGetUserInputs(r *http.Request) (userInputs UserInputs, err error) {
return
}

userInputs.UserId = strings.ToLower(userInputs.UserId)
userInputs.UserID = strings.ToLower(userInputs.UserID)

err = val.Errors{
"user_id": val.Validate(userInputs.UserId, val.Required),
"user_id": val.Validate(userInputs.UserID, val.Required),
"age_lower_bound": val.Validate(userInputs.AgeLowerBound, val.Required),
"uniqueness": val.Validate(val.Required),
"nationality": val.Validate(userInputs.Nationality, val.Required),
Expand Down

0 comments on commit 7d7c9bd

Please sign in to comment.