Skip to content

Commit

Permalink
clerk based sign in
Browse files Browse the repository at this point in the history
  • Loading branch information
DOOduneye committed Mar 18, 2024
1 parent 3329cce commit b7e3113
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
1 change: 1 addition & 0 deletions backend/src/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func Init(db *gorm.DB, pinecone search.PineconeClientInterface, settings config.
Validate: validate,
Email: emailService,
Clerk: clerkService,
Pinecone: &pinecone,
},
}

Expand Down
1 change: 1 addition & 0 deletions backend/src/services/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ func (a *AuthService) SendCode(userID string) *errors.Error {
return nil
}

/* trunk-ignore(golangci-lint/cyclop) */
func (a *AuthService) VerifyEmail(emailBody models.VerifyEmailRequestBody) *errors.Error {

Check failure on line 300 in backend/src/services/auth.go

View workflow job for this annotation

GitHub Actions / Lint

calculated cyclomatic complexity for function VerifyEmail is 11, max is 10 (cyclop)
if err := a.Validate.Struct(emailBody); err != nil {
return &errors.FailedToValidateUser
Expand Down
8 changes: 4 additions & 4 deletions backend/src/services/club.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (c *ClubService) GetClubs(queryParams *models.ClubQueryParams) ([]models.Cl
return nil, &errors.FailedToValidatePage
}

return transactions.GetClubs(c.DB, c.Pinecone, queryParams)
return transactions.GetClubs(c.DB, *c.Pinecone, queryParams)
}

func (c *ClubService) CreateClub(clubBody models.CreateClubRequestBody) (*models.Club, *errors.Error) {
Expand All @@ -46,7 +46,7 @@ func (c *ClubService) CreateClub(clubBody models.CreateClubRequestBody) (*models
return nil, &errors.FailedToMapRequestToModel
}

return transactions.CreateClub(c.DB, c.Pinecone, clubBody.UserID, *club)
return transactions.CreateClub(c.DB, *c.Pinecone, clubBody.UserID, *club)
}

func (c *ClubService) GetClub(id string) (*models.Club, *errors.Error) {
Expand Down Expand Up @@ -77,7 +77,7 @@ func (c *ClubService) UpdateClub(id string, clubBody models.UpdateClubRequestBod
return nil, &errors.FailedToMapRequestToModel
}

return transactions.UpdateClub(c.DB, c.Pinecone, *idAsUUID, *club)
return transactions.UpdateClub(c.DB, *c.Pinecone, *idAsUUID, *club)
}

func (c *ClubService) DeleteClub(id string) *errors.Error {
Expand All @@ -86,5 +86,5 @@ func (c *ClubService) DeleteClub(id string) *errors.Error {
return &errors.FailedToValidateID
}

return transactions.DeleteClub(c.DB, c.Pinecone, *idAsUUID)
return transactions.DeleteClub(c.DB, *c.Pinecone, *idAsUUID)
}
2 changes: 1 addition & 1 deletion backend/src/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ type ServiceParams struct {
Validate *validator.Validate
Email *email.EmailService
Clerk *auth.ClerkService
Pinecone *search.PineconeClient
Pinecone *search.PineconeClientInterface
}
18 changes: 9 additions & 9 deletions cli/commands/clean_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import (
)

func ClearDBCommand() *cli.Command {
command := cli.Command{
Name: "clean",
Category: "Database Operations",
Aliases: []string{"c"},
Usage: "Remove databases used for testing",
Action: func(c *cli.Context) error {
if c.Args().Len() > 0 {
return cli.Exit("Invalid arguments", 1)
}
command := cli.Command{
Name: "clean",
Category: "Database Operations",
Aliases: []string{"c"},
Usage: "Remove databases used for testing",
Action: func(c *cli.Context) error {
if c.Args().Len() > 0 {
return cli.Exit("Invalid arguments", 1)
}

return CleanTestDBs(context.Background())

Check failure on line 25 in cli/commands/clean_tests.go

View workflow job for this annotation

GitHub Actions / Lint

File is not `goimports`-ed (goimports)
},
Expand Down
4 changes: 0 additions & 4 deletions frontend/yarn.lock

This file was deleted.

0 comments on commit b7e3113

Please sign in to comment.