fix: 修正删除标签使用正确的ID字段
This commit is contained in:
@@ -129,9 +129,9 @@ export function updateKnowledgeBaseTag(
|
|||||||
return put(`/api/v1/knowledge-bases/${kbId}/tags/${tagId}`, data);
|
return put(`/api/v1/knowledge-bases/${kbId}/tags/${tagId}`, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function deleteKnowledgeBaseTag(kbId: string, tagId: string, params?: { force?: boolean }) {
|
export function deleteKnowledgeBaseTag(kbId: string, tagSeqId: number, params?: { force?: boolean }) {
|
||||||
const forceQuery = params?.force ? '?force=true' : '';
|
const forceQuery = params?.force ? '?force=true' : '';
|
||||||
return del(`/api/v1/knowledge-bases/${kbId}/tags/${tagId}${forceQuery}`);
|
return del(`/api/v1/knowledge-bases/${kbId}/tags/${tagSeqId}${forceQuery}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function updateKnowledgeTagBatch(data: { updates: Record<string, string | null> }) {
|
export function updateKnowledgeTagBatch(data: { updates: Record<string, string | null> }) {
|
||||||
|
|||||||
@@ -332,7 +332,7 @@ const confirmDeleteTag = (tag: any) => {
|
|||||||
t('knowledgeBase.tagDeleteDesc', { name: tag.name }) as string,
|
t('knowledgeBase.tagDeleteDesc', { name: tag.name }) as string,
|
||||||
);
|
);
|
||||||
if (!confirm) return;
|
if (!confirm) return;
|
||||||
deleteKnowledgeBaseTag(kbId.value, tag.id, { force: true })
|
deleteKnowledgeBaseTag(kbId.value, tag.seq_id, { force: true })
|
||||||
.then(() => {
|
.then(() => {
|
||||||
MessagePlugin.success(t('knowledgeBase.tagDeleteSuccess'));
|
MessagePlugin.success(t('knowledgeBase.tagDeleteSuccess'));
|
||||||
if (selectedTagId.value === tag.id) {
|
if (selectedTagId.value === tag.id) {
|
||||||
|
|||||||
@@ -1585,7 +1585,7 @@ const confirmDeleteTag = (tag: any) => {
|
|||||||
cancelBtn: t('common.cancel'),
|
cancelBtn: t('common.cancel'),
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
try {
|
try {
|
||||||
await deleteKnowledgeBaseTag(props.kbId, tag.id, { force: true })
|
await deleteKnowledgeBaseTag(props.kbId, tag.seq_id, { force: true })
|
||||||
MessagePlugin.success(t('knowledgeBase.tagDeleteSuccess'))
|
MessagePlugin.success(t('knowledgeBase.tagDeleteSuccess'))
|
||||||
if (selectedTagId.value === tag.seq_id) {
|
if (selectedTagId.value === tag.seq_id) {
|
||||||
// Reset to show all entries when current tag is deleted
|
// Reset to show all entries when current tag is deleted
|
||||||
|
|||||||
Reference in New Issue
Block a user