Skip to content

Commit

Permalink
pkp#10636 update notifications on submission submit
Browse files Browse the repository at this point in the history
  • Loading branch information
taslangraham committed Dec 2, 2024
1 parent 86be4dd commit 56173b4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion api/v1/submissions/PKPSubmissionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 56173b4

Please sign in to comment.