Skip to content

Commit

Permalink
small type that caused things to go south :D
Browse files Browse the repository at this point in the history
  • Loading branch information
YazeedAlKhalaf committed Jan 16, 2025
1 parent 77ad704 commit 69c704e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions falak/pkg/api/calendar/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ type service struct {
pv protovalidate.Validator
store store.Queries
apiMetadata apimetadata.ApiMetadata
calDAVPasswordEncryptionKey string
calDavPasswordEncryptionKey string

calendarv1connect.UnimplementedCalendarServiceHandler
}

func (s *service) GetCalDAVAccount(ctx context.Context, r *connect.Request[calendarv1.GetCalDavAccountRequest]) (*connect.Response[calendarv1.GetCalDavAccountResponse], error) {
func (s *service) GetCalDavAccount(ctx context.Context, r *connect.Request[calendarv1.GetCalDavAccountRequest]) (*connect.Response[calendarv1.GetCalDavAccountResponse], error) {
if err := s.pv.Validate(r.Msg); err != nil {
log.Ctx(ctx).Err(err).Msg("invalid request")
return nil, connect.NewError(connect.CodeInvalidArgument, err)
Expand All @@ -44,9 +44,9 @@ func (s *service) GetCalDAVAccount(ctx context.Context, r *connect.Request[calen
return nil, internalError
}

calDAVAccount, err := s.store.GetCalDAVAccountByCustomerId(ctx, store.GetCalDAVAccountByCustomerIdParams{
calDavAccount, err := s.store.GetCalDAVAccountByCustomerId(ctx, store.GetCalDAVAccountByCustomerIdParams{
CustomerID: customer.ID,
EncryptionKey: s.calDAVPasswordEncryptionKey,
EncryptionKey: s.calDavPasswordEncryptionKey,
})
if err != nil {
log.Ctx(ctx).Err(err).Msg("failed running GetCalDAVAccountByCustomerId")
Expand All @@ -55,8 +55,8 @@ func (s *service) GetCalDAVAccount(ctx context.Context, r *connect.Request[calen

return &connect.Response[calendarv1.GetCalDavAccountResponse]{
Msg: &calendarv1.GetCalDavAccountResponse{
Username: calDAVAccount.Username,
Password: calDAVAccount.DecryptedPassword,
Username: calDavAccount.Username,
Password: calDavAccount.DecryptedPassword,
},
}, nil
}
Expand All @@ -66,6 +66,6 @@ func NewService(pv protovalidate.Validator, store store.Queries, apiMetadata api
pv: pv,
store: store,
apiMetadata: apiMetadata,
calDAVPasswordEncryptionKey: calDAVPasswordEncryptionKey,
calDavPasswordEncryptionKey: calDAVPasswordEncryptionKey,
}
}

0 comments on commit 69c704e

Please sign in to comment.