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 Nov 29, 2024
1 parent c4cf339 commit 96e4bf0
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions api/v1/submissions/PKPSubmissionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -587,21 +587,21 @@ public function edit(SlimRequest $slimRequest, APIResponse $response, array $arg

if (isset($parsedBody)){
$params = $this->convertStringsToSchema(PKPSchemaService::SCHEMA_SUBMISSION, $parsedBody);

$readOnlyErrors = $this->getWriteDisabledErrors(PKPSchemaService::SCHEMA_SUBMISSION, $params);
if (!empty($readOnlyErrors)) {
return $response->withStatus(400)->withJson($readOnlyErrors);
}

$params['id'] = $submission->getId();
$params['contextId'] = $request->getContext()->getId();

$errors = Repo::submission()->validate($submission, $params, $request->getContext());

if (!empty($errors)) {
return $response->withStatus(400)->withJson($errors);
}

Repo::submission()->edit($submission, $params);
}

Expand Down Expand Up @@ -743,6 +743,16 @@ public function submit(SlimRequest $slimRequest, APIResponse $response, array $a
Repo::eventLog()->add($eventLog);
}


$notificationManager = new NotificationManager();
$notificationManager->updateNotification(
Application::get()->getRequest(),
[PKPNotification::NOTIFICATION_TYPE_APPROVE_SUBMISSION],
null,
PKPApplication::ASSOC_TYPE_SUBMISSION,
$submission->getId()
);

$userGroups = Repo::userGroup()
->getCollector()
->filterByContextIds([$context->getId()])
Expand Down

0 comments on commit 96e4bf0

Please sign in to comment.