From b7e311330fa1058770c70adae0210df578107ce7 Mon Sep 17 00:00:00 2001 From: David Oduneye Date: Mon, 18 Mar 2024 16:43:21 -0400 Subject: [PATCH] clerk based sign in --- backend/src/server/server.go | 1 + backend/src/services/auth.go | 1 + backend/src/services/club.go | 8 ++++---- backend/src/types/params.go | 2 +- cli/commands/clean_tests.go | 18 +++++++++--------- frontend/yarn.lock | 4 ---- 6 files changed, 16 insertions(+), 18 deletions(-) delete mode 100644 frontend/yarn.lock diff --git a/backend/src/server/server.go b/backend/src/server/server.go index 26fa7a370..a12a7b4fb 100644 --- a/backend/src/server/server.go +++ b/backend/src/server/server.go @@ -51,6 +51,7 @@ func Init(db *gorm.DB, pinecone search.PineconeClientInterface, settings config. Validate: validate, Email: emailService, Clerk: clerkService, + Pinecone: &pinecone, }, } diff --git a/backend/src/services/auth.go b/backend/src/services/auth.go index 218a3fc6d..885de8c46 100644 --- a/backend/src/services/auth.go +++ b/backend/src/services/auth.go @@ -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 { if err := a.Validate.Struct(emailBody); err != nil { return &errors.FailedToValidateUser diff --git a/backend/src/services/club.go b/backend/src/services/club.go index a0bc646e7..9c8220231 100644 --- a/backend/src/services/club.go +++ b/backend/src/services/club.go @@ -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) { @@ -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) { @@ -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 { @@ -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) } diff --git a/backend/src/types/params.go b/backend/src/types/params.go index f66714234..436ecb7c3 100644 --- a/backend/src/types/params.go +++ b/backend/src/types/params.go @@ -23,5 +23,5 @@ type ServiceParams struct { Validate *validator.Validate Email *email.EmailService Clerk *auth.ClerkService - Pinecone *search.PineconeClient + Pinecone *search.PineconeClientInterface } diff --git a/cli/commands/clean_tests.go b/cli/commands/clean_tests.go index e69237931..9280b65a2 100644 --- a/cli/commands/clean_tests.go +++ b/cli/commands/clean_tests.go @@ -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()) }, diff --git a/frontend/yarn.lock b/frontend/yarn.lock deleted file mode 100644 index fb57ccd13..000000000 --- a/frontend/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - -