Change ui on led sign page to have a tab, if the user is an officer or admin#1988
Open
Embotic-Wayne wants to merge 3 commits intoRequest-Button4LEDSIGNfrom
Open
Change ui on led sign page to have a tab, if the user is an officer or admin#1988Embotic-Wayne wants to merge 3 commits intoRequest-Button4LEDSIGNfrom
Embotic-Wayne wants to merge 3 commits intoRequest-Button4LEDSIGNfrom
Conversation
86a5910 to
0572c22
Compare
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
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.

-officer and admin tab for approving led sign requests
-table for approving requests from members
-i will make it so members can see the ui once approved in step 5
-for the permission requests it shows the name, email, and the date it was requested