Change ui on led sign page to have a tab, if the user is an officer or admin#1988
Merged
Conversation
wayngo
force-pushed
the
Request-Button4LEDSIGN
branch
from
January 3, 2026 06:42
86a5910 to
0572c22
Compare
wayngo
force-pushed
the
requestUI4admins
branch
from
January 3, 2026 06:43
9a95a43 to
f941ea6
Compare
Collaborator
Author
evanugarte
reviewed
Jan 25, 2026
Comment on lines
+17
to
+20
| approved: { | ||
| type: Boolean, | ||
| default: false, | ||
| }, |
Collaborator
There was a problem hiding this comment.
lets use an enum here, like PENDING, APPROVED, DENIED
evanugarte
reviewed
Jan 29, 2026
Comment on lines
+28
to
+36
| if (existingRequest) { | ||
| if (existingRequest.status === PermissionRequestStatus.PENDING) { | ||
| return res.sendStatus(CONFLICT); | ||
| } | ||
| existingRequest.status = PermissionRequestStatus.PENDING; | ||
| existingRequest.createdAt = new Date(); | ||
| await existingRequest.save(); | ||
| return res.sendStatus(OK); | ||
| } |
Collaborator
There was a problem hiding this comment.
i think if it exists we just return conflict no matter what, what do you think
if its denied, we can set the status to pending
Comment on lines
+89
to
+91
| if (!type || !Object.keys(PermissionRequestTypes).includes(type)) { | ||
| return res.status(BAD_REQUEST).send({ error: 'Invalid type' }); | ||
| } |
Collaborator
There was a problem hiding this comment.
same thing like we did before can we do
`type ${type} is invalid, valid types are ${Object.keys(PermissionRequestTypes)}`
Comment on lines
+48
to
+57
| if (res.ok) { | ||
| // API returns 200 with no body, so we just mark success | ||
| status.responseData = true; | ||
| } else if (res.status === 409) { | ||
| // CONFLICT - duplicate request | ||
| status.error = true; | ||
| status.responseData = 'Request already exists'; | ||
| } else { | ||
| status.error = true; | ||
| } |
Collaborator
There was a problem hiding this comment.
Suggested change
| if (res.ok) { | |
| // API returns 200 with no body, so we just mark success | |
| status.responseData = true; | |
| } else if (res.status === 409) { | |
| // CONFLICT - duplicate request | |
| status.error = true; | |
| status.responseData = 'Request already exists'; | |
| } else { | |
| status.error = true; | |
| } | |
| status.error = !!res.ok; | |
| if (res.status === 409) { | |
| // CONFLICT - duplicate request | |
| status.responseData = 'Request already exists'; | |
| } |
| }); | ||
|
|
||
| if (res.ok) { | ||
| status.responseData = true; |
Collaborator
There was a problem hiding this comment.
lets not even set responseData
for these create/delete requests we can just rely on if error is true/false for checking if it worked
evanugarte
force-pushed
the
Request-Button4LEDSIGN
branch
from
March 4, 2026 05:09
aa690ca to
cfce7f9
Compare
evanugarte
force-pushed
the
Request-Button4LEDSIGN
branch
from
March 9, 2026 00:33
39cc753 to
48db042
Compare
evanugarte
force-pushed
the
requestUI4admins
branch
from
March 9, 2026 03:07
0f1be4d to
9628ae7
Compare
evanugarte
approved these changes
Mar 9, 2026
evanugarte
force-pushed
the
requestUI4admins
branch
from
March 9, 2026 03:10
9628ae7 to
d6ccb9e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Uh oh!
There was an error while loading. Please reload this page.