fix: fix deleting tag from tag lists (#3311)

This commit is contained in:
Nabiel Omar Syarif 2024-05-06 06:38:15 +07:00 committed by GitHub
parent e32a585bbf
commit 56ceba2dec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 7 deletions

View file

@ -137,13 +137,7 @@ func (s *APIV1Service) RenameTag(ctx context.Context, request *v1pb.RenameTagReq
}
func (s *APIV1Service) DeleteTag(ctx context.Context, request *v1pb.DeleteTagRequest) (*emptypb.Empty, error) {
userID, err := ExtractUserIDFromName(request.Tag.Creator)
if err != nil {
return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err)
}
user, err := s.Store.GetUser(ctx, &store.FindUser{
ID: &userID,
})
user, err := getCurrentUser(ctx, s.Store)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get user: %v", err)
}

View file

@ -130,6 +130,7 @@ const TagItemContainer: React.FC<TagItemContainerProps> = (props: TagItemContain
dialogName: "delete-tag-dialog",
onConfirm: async () => {
await tagStore.deleteTag(tag.text);
tagStore.fetchTags({ skipCache: true });
},
});
};