Many functions have been added to the boarderRouter that handle CRUD options dealing with panels, stacks, and cards. Alongside the standard crud options, boards, panels, and cards have been given a /details which grabs all sub-components (for panels it grabs all its stacks and all cards related to that stack).
A part of this PR is more changes to the DB (shocker). They're fairly minor! Now the panel, stack, and cards ON DELETE CASCADE to remove any cleanup needed when deleting an item's parent.
Because a user now has A LOT of permissions, we have hit the cap on the amount of permissions we can get back from an API call from auth0. This was causing inconsistency in the methods, so permissions are now checked and sent through the token.
Testing
Boards
Create Board Still Works
Get Board Details
No Panels:
Stack with no card:
Panels
Get Panels
Empty array if board has no panels:
Create Panel
Missing title:
Missing create_panel perm:
Get Panel
Update Panel
Missing update_panel perm:
Updating position:
Attempting to update position to out-of-range value:
Delete Panel
\
Stacks
Get Stacks
Empty array if panel has no stack:
Create Stack
Missing title:
Get Stack
Update Stack
Updating position:
Attempting to update position to out-of-range value:
Delete Stack
Cards
Get Cards
Empty array if stack has no card:
Create Card
Missing title:
Get Card
Update Card
Updating position:
Attempting to update position to out-of-range value:
Moving Card to new stack/panel:
Attempting to move Card to new stack/panel on another board:
Delete Card
Did I test everything no? Am I pretty sure everything works well enough? Yes 😄 (and Tyler will let me know if it doesn't)
Problem
See #47 for details Closes #47 Closes #57
Solution
Many functions have been added to the
boarderRouter
that handle CRUD options dealing with panels, stacks, and cards. Alongside the standard crud options, boards, panels, and cards have been given a/details
which grabs all sub-components (for panels it grabs all its stacks and all cards related to that stack).A part of this PR is more changes to the DB (shocker). They're fairly minor! Now the panel, stack, and cards
ON DELETE CASCADE
to remove any cleanup needed when deleting an item's parent.Because a user now has A LOT of permissions, we have hit the cap on the amount of permissions we can get back from an API call from auth0. This was causing inconsistency in the methods, so permissions are now checked and sent through the token.
Testing
Boards
Create Board Still Works
Get Board Details
No Panels: Stack with no card:
Panels
Get Panels
Empty array if board has no panels:
Create Panel
Missing title: Missing create_panel perm:
Get Panel
Update Panel
Missing update_panel perm: Updating position: Attempting to update position to out-of-range value:
Delete Panel
\
Stacks
Get Stacks
Empty array if panel has no stack:
Create Stack
Missing title:
Get Stack
Update Stack
Updating position: Attempting to update position to out-of-range value:
Delete Stack
Cards
Get Cards
Empty array if stack has no card:
Create Card
Missing title:
Get Card
Update Card
Updating position: Attempting to update position to out-of-range value: Moving Card to new stack/panel: Attempting to move Card to new stack/panel on another board:
Delete Card
Did I test everything no? Am I pretty sure everything works well enough? Yes 😄 (and Tyler will let me know if it doesn't)