Skip to content
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

#137 toggle task template #143

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

#137 toggle task template #143

wants to merge 4 commits into from

Conversation

bderbs30
Copy link

@bderbs30 bderbs30 commented Feb 4, 2025

Changes

Adds visibility to ICustomizedBattery Schema. Created an endpoint to update the field based on the given status (on = true off = false)

Test Cases

updates battery to visible
updates battery to non visible

Screenshots

image
image

To Do

  • Write unit tests (apart of other ticket tho)

Closes #137

Copy link
Contributor

@arath7 arath7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just left one comment about more graceful error handling but lmk what you guys think--should we just default to off in this case or do you think it would be better to throw this error?

batteryId: string,
visibility: string
): APIResponse<ICustomizedBattery> => {
if (visibility !== "on" && visibility !== "off") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a similar comment on Armaan's PR #144 but I think it might be better if we do more graceful error handling here and default to visibility being off if we somehow reach these case because there isn't much the user will be able to do if they hit this case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backend: API request for hiding/showing task templates for non-admin users
3 participants