feat: Ability to add/remove tags from any list of messages #189

This commit is contained in:
rustmailer
2026-03-26 21:22:21 +08:00
parent 5d0039cb74
commit 3f11c5dbbf
30 changed files with 805 additions and 66 deletions
+4 -6
View File
@@ -21,9 +21,12 @@ import { update_tags } from '@/api/search/api';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { toast } from './use-toast';
export type TagAction = 'Add' | 'Remove' | 'Overwrite';
export interface UpdateTagsParams {
updates: Record<number, string[]>;
tags: string[];
action: TagAction;
}
export function useUpdateTags() {
@@ -31,12 +34,7 @@ export function useUpdateTags() {
return useMutation({
mutationFn: async (params: UpdateTagsParams) => {
const { updates, tags } = params;
const payload = {
updates,
tags
};
return update_tags(payload);
return update_tags(params);
},
onSuccess: () => {