-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API for emailLogEntry #10455
API for emailLogEntry #10455
Conversation
34ddfd9
to
46d8f15
Compare
500b13e
to
cbb0f53
Compare
api/v1/emails/PKPEmailController.php
Outdated
|
||
foreach ($illuminateRequest->query->keys() as $queryParam) { | ||
if (!in_array($queryParam, $allowedQueryParams)) { | ||
return response()->json([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand where this is coming from but I don't think we should respond with an error of an invalid query parameter is included (this is the case elsewhere as well). For example, I'm using an XDEBUG_SESSION query parameter to debug API requests and this will fail because of that. I think it's okay to have the correct query parameters documented and silently ignore others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted. I'll update accordingly
api/v1/emails/PKPEmailController.php
Outdated
protected function getMany(Request $illuminateRequest): JsonResponse | ||
{ | ||
$allowedQueryParams = ['submissionId', 'eventType']; | ||
$authorEmailLogEventTypes = [ SubmissionEmailLogEventType::EDITOR_NOTIFY_AUTHOR, SubmissionEmailLogEventType::COPYEDIT_NOTIFY_AUTHOR,SubmissionEmailLogEventType::PROOFREAD_NOTIFY_AUTHOR]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some spacing issues in the array.
69914ed
to
e9a1eaf
Compare
e9a1eaf
to
770b9a9
Compare
For #10412