From 56173b48a55dd68ecfe98481d2949b745673d61b Mon Sep 17 00:00:00 2001 From: Taslan Graham Date: Mon, 2 Dec 2024 10:27:03 -0500 Subject: [PATCH] pkp/pkp-lib#10636 update notifications on submission submit --- api/v1/submissions/PKPSubmissionController.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/api/v1/submissions/PKPSubmissionController.php b/api/v1/submissions/PKPSubmissionController.php index 0cf5b342128..a0c517552e0 100644 --- a/api/v1/submissions/PKPSubmissionController.php +++ b/api/v1/submissions/PKPSubmissionController.php @@ -680,7 +680,6 @@ public function add(Request $illuminateRequest): JsonResponse /** @var GenreDAO $genreDao */ $genreDao = DAORegistry::getDAO('GenreDAO'); $genres = $genreDao->getByContextId($submission->getData('contextId'))->toArray(); - return response()->json(Repo::submission()->getSchemaMap()->map($submission, $userGroups, $genres), Response::HTTP_OK); } @@ -856,6 +855,15 @@ public function submit(Request $illuminateRequest): JsonResponse $genreDao = DAORegistry::getDAO('GenreDAO'); $genres = $genreDao->getByContextId($submission->getData('contextId'))->toArray(); + $notificationManager = new NotificationManager(); + $notificationManager->updateNotification( + Application::get()->getRequest(), + [Notification::NOTIFICATION_TYPE_APPROVE_SUBMISSION], + null, + PKPApplication::ASSOC_TYPE_SUBMISSION, + $submission->getId() + ); + return response()->json(Repo::submission()->getSchemaMap()->map($submission, $userGroups, $genres), Response::HTTP_OK); }