-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feat/move resources #139
Feat/move resources #139
Conversation
* feat: add RootType Directory This commit adds a RootType to the Directory class so that we can retrieve directories from the root of a repo. * feat: new endpoint for retrieving information on all folders This commit introduces a new GET `/:siteName/folders/all` endpoint which: 1) gets the names of all collections/folders within the repo 2) gets the collection.yml directory config file for each collection * fix: remove _ before sending folder name Co-authored-by: jiehao <[email protected]>
As discussed offline, since there are no use cases for bulk movement of resource pages between resource categories, we will be modifying this feature to move only single resource pages from one category to another |
This reverts commit 81b4786.
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.
LGTM, only a minor typo in route params
middleware/auth.js
Outdated
@@ -125,6 +126,7 @@ auth.get('/v1/sites/:siteName/resources', verifyJwt) | |||
auth.post('/v1/sites/:siteName/resources', verifyJwt) | |||
auth.delete('/v1/sites/:siteName/resources/:resourceName', verifyJwt) | |||
auth.post('/v1/sites/:siteName/resources/:resourceName/rename/:newResourceName', verifyJwt) | |||
auth.post('/v1/sites/:siteName/resources/:resourceRoomName/move/:newResourceRoomName', verifyJwt) |
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.
The route params specified here don't match the ones specified in the resources route file - resourceRoomName
vs resourceName
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.
good catch, fixed here fd3410c
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.
LGTM!
* Feat/get all collections directories (#117) * feat: add RootType Directory This commit adds a RootType to the Directory class so that we can retrieve directories from the root of a repo. * feat: new endpoint for retrieving information on all folders This commit introduces a new GET `/:siteName/folders/all` endpoint which: 1) gets the names of all collections/folders within the repo 2) gets the collection.yml directory config file for each collection * fix: remove _ before sending folder name Co-authored-by: jiehao <[email protected]> * feat: add moveResources API * fix: adds backend check for if resource categories exist prior to move * fix: update resourcePages routes to handle Base64 encoding on backend * fix: update moveResource route to work on single file only * Revert "fix: update moveResource route to work on single file only" This reverts commit 81b4786. * fix: typo in auth for resources route Co-authored-by: kwajiehao <[email protected]> Co-authored-by: jiehao <[email protected]>
This PR adds an endpoint for moving resources from one resource room to another. Similar to the move endpoints for collection pages and pages, it takes in an array of files and iteratively deletes and creates new files.
This PR also adds simple refactoring to the resourcePages routes to handle Base64 encoding and decoding on the backend, extending #138.