From 83e38bb3201372f87a965317c1ff2faafdbbc1ab Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 27 Mar 2023 05:00:16 +0200 Subject: [PATCH] fix(backend): use correct ID in patch member endpoint --- backend/routes/member/patch_member.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/routes/member/patch_member.go b/backend/routes/member/patch_member.go index 8182c6f..2956114 100644 --- a/backend/routes/member/patch_member.go +++ b/backend/routes/member/patch_member.go @@ -184,7 +184,7 @@ func (s *Server) patchMember(w http.ResponseWriter, r *http.Request) error { return err } - hash, err := s.DB.WriteMemberAvatar(ctx, id, webp, jpg) + hash, err := s.DB.WriteMemberAvatar(ctx, m.ID, webp, jpg) if err != nil { log.Errorf("uploading member avatar: %v", err) return err @@ -193,7 +193,7 @@ func (s *Server) patchMember(w http.ResponseWriter, r *http.Request) error { // delete current avatar if member has one if m.Avatar != nil { - err = s.DB.DeleteMemberAvatar(ctx, claims.UserID, *m.Avatar) + err = s.DB.DeleteMemberAvatar(ctx, m.ID, *m.Avatar) if err != nil { log.Errorf("deleting existing avatar: %v", err) }