mirror of
https://github.com/usememos/memos.git
synced 2025-01-01 10:01:54 +08:00
fix: fix deleting tag from tag lists (#3311)
This commit is contained in:
parent
e32a585bbf
commit
56ceba2dec
2 changed files with 2 additions and 7 deletions
|
@ -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) {
|
func (s *APIV1Service) DeleteTag(ctx context.Context, request *v1pb.DeleteTagRequest) (*emptypb.Empty, error) {
|
||||||
userID, err := ExtractUserIDFromName(request.Tag.Creator)
|
user, err := getCurrentUser(ctx, s.Store)
|
||||||
if err != nil {
|
|
||||||
return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err)
|
|
||||||
}
|
|
||||||
user, err := s.Store.GetUser(ctx, &store.FindUser{
|
|
||||||
ID: &userID,
|
|
||||||
})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, status.Errorf(codes.Internal, "failed to get user: %v", err)
|
return nil, status.Errorf(codes.Internal, "failed to get user: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,6 +130,7 @@ const TagItemContainer: React.FC<TagItemContainerProps> = (props: TagItemContain
|
||||||
dialogName: "delete-tag-dialog",
|
dialogName: "delete-tag-dialog",
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
await tagStore.deleteTag(tag.text);
|
await tagStore.deleteTag(tag.text);
|
||||||
|
tagStore.fetchTags({ skipCache: true });
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue