From 2fdfb8f7aa0100c8ecb1e38fe97d5e5798763ce5 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Mon, 14 Mar 2022 10:06:55 +0900 Subject: [PATCH] Fix project update --- backend/projects/serializers.py | 5 +++++ .../application/project/projectApplicationService.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/backend/projects/serializers.py b/backend/projects/serializers.py index 36b05072..99f5fc2c 100644 --- a/backend/projects/serializers.py +++ b/backend/projects/serializers.py @@ -83,6 +83,11 @@ class ProjectSerializer(serializers.ModelSerializer): tags.save(project=project) return project + def update(self, instance, validated_data): + # Don't update tags. Please use TagAPI. + validated_data.pop("tags", None) + return super().update(instance, validated_data) + class TextClassificationProjectSerializer(ProjectSerializer): class Meta(ProjectSerializer.Meta): diff --git a/frontend/services/application/project/projectApplicationService.ts b/frontend/services/application/project/projectApplicationService.ts index ae50b497..132d51ca 100644 --- a/frontend/services/application/project/projectApplicationService.ts +++ b/frontend/services/application/project/projectApplicationService.ts @@ -35,6 +35,7 @@ export class ProjectApplicationService { public async update(item: ProjectWriteDTO): Promise { try { const project = this.toWriteModel(item) + project.tags = [] await this.repository.update(project) } catch(e: any) { throw new Error(e.response.data.detail)