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

Feat/move resources #139

Merged
merged 18 commits into from
Mar 31, 2021
Merged

Feat/move resources #139

merged 18 commits into from
Mar 31, 2021

Conversation

gweiying
Copy link
Contributor

@gweiying gweiying commented Mar 23, 2021

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.

kwajiehao and others added 13 commits March 3, 2021 14:21
* 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]>
@kwajiehao
Copy link
Contributor

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

Copy link
Contributor

@kwajiehao kwajiehao left a 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

@@ -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)
Copy link
Contributor

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

Copy link
Contributor Author

@gweiying gweiying Mar 25, 2021

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

Copy link
Contributor

@kwajiehao kwajiehao left a comment

Choose a reason for hiding this comment

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

LGTM!

@gweiying gweiying merged commit eec00a7 into staging Mar 31, 2021
@gweiying gweiying deleted the feat/move-resources branch March 31, 2021 05:22
harishv7 pushed a commit that referenced this pull request Feb 17, 2023
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants