diff --git a/frontend/src/lib/types/ProjectTag.ts b/frontend/src/lib/types/ProjectTag.ts index 729ee4a..f9ad221 100644 --- a/frontend/src/lib/types/ProjectTag.ts +++ b/frontend/src/lib/types/ProjectTag.ts @@ -177,7 +177,7 @@ export default class ProjectTag { parseOptionUpdate(json: any) { if (!json) return; - const option = this._options.find((option) => option.id === json.id); + const option = this._options.find((option) => option.id === json.option_id); if (!option) return; option.parseUpdate(json); diff --git a/frontend/src/lib/utils/webSocketManager.ts b/frontend/src/lib/utils/webSocketManager.ts index f75aa51..2bfe6b2 100644 --- a/frontend/src/lib/utils/webSocketManager.ts +++ b/frontend/src/lib/utils/webSocketManager.ts @@ -221,18 +221,15 @@ function applyProjectTag(data: any) { } function applyProjectTagOption(data: any) { - const projectTag = ProjectTag.fromId(data.project_tag_id); - if (!projectTag) { - toastWarning('Failed to parse project tag option update: project tag not found'); - return; - } - if (data.action === 'create') { - projectTag.parseOption(data.data); + const projectTag = ProjectTag.fromId(data.data.tag_id); + projectTag?.parseOption(data.data); } else if (data.action === 'update') { - projectTag.parseOptionUpdate(data.changes); + const projectTag = ProjectTag.fromId(data.tag_id); + projectTag?.parseOptionUpdate(data.changes); } else if (data.action === 'delete') { - projectTag.parseOptionDelete(data.id); + const projectTag = ProjectTag.fromId(data.tag_id); + projectTag?.parseOptionDelete(data.option_id); } else { toastWarning('Failed to parse project tag option update: unknown action'); return;