From 1bfbe146fa8db47b5c7055bffa0d0e79700d6eac Mon Sep 17 00:00:00 2001 From: Ewout Verlinde Date: Fri, 24 May 2024 13:48:49 +0200 Subject: [PATCH] fix: feedback serializer and frontend model --- backend/api/views/submission_view.py | 7 +-- .../src/components/projects/ProjectList.vue | 18 +++--- .../components/submissions/AllSubmission.vue | 10 ++-- frontend/src/types/Feedback.ts | 5 +- .../src/views/submissions/SubmissionView.vue | 56 ++++++------------- 5 files changed, 37 insertions(+), 59 deletions(-) diff --git a/backend/api/views/submission_view.py b/backend/api/views/submission_view.py index 7f013959..740c71ef 100644 --- a/backend/api/views/submission_view.py +++ b/backend/api/views/submission_view.py @@ -52,11 +52,8 @@ def _add_feedback(self, request, **_) -> Response: serializer = FeedbackSerializer(data=request.data, context=context) if serializer.is_valid(): - serializer.save(submission=submission) - return Response({ - "message": "Success", - "feedback": serializer.data - }) + serializer.save(submission=submission, author=request.user) + return Response(serializer.data) return Response(serializer.errors, status=400) diff --git a/frontend/src/components/projects/ProjectList.vue b/frontend/src/components/projects/ProjectList.vue index cbe8eda1..7fc48e25 100644 --- a/frontend/src/components/projects/ProjectList.vue +++ b/frontend/src/components/projects/ProjectList.vue @@ -66,17 +66,17 @@ const incomingProjects = computed(() => {