const mutateTag = (id: string, tagname: string, type: string) => {
setRef(
(meta) => meta.metadata.id === id,
'metadata',
'tags',
produce((tags) => {
if (type === 'add') {
tags?.push(tagname);
}
if (type === 'remove') {
tags = tags?.filter((tag) => tag !== tagname);
}
}),
);
};
const mutateTag = (id: string, tagname: string, type: string) => {
setRef(
(meta) => meta.metadata.id === id,
'metadata',
'tags',
produce((tags) => {
if (type === 'add') {
tags?.push(tagname);
}
if (type === 'remove') {
tags = tags?.filter((tag) => tag !== tagname);
}
}),
);
};