-
Notifications
You must be signed in to change notification settings - Fork 8
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
Use ':root', rather than alias 'root' for default root collection #207
Conversation
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.
This looks really good @ekraffmiller!
I suggested a commit (maybe is not needed) and have a doubt about this part of the code in collectionHelper.ts
, should be use ':root' instead of 'root' also there?
export async function createCollectionViaApi(
collectionAlias: string,
parentCollectionAlias: string | undefined = undefined
): Promise<CollectionPayload> {
try {
if (parentCollectionAlias == undefined) {
parentCollectionAlias = 'root'
}
Another thing, just out of curiosity, do all API endpoints work with this special id ':root'?
Yes, it should be |
fix comments in GetCollection.ts Co-authored-by: German Gonzalo Saracca <[email protected]>
Did visual inspection of code. Merging PR |
What this PR does / why we need it:
The root collection alias, 'root' is not a constant, it is an editable field in the Collection. So we need to use the special keyword ':root' to get the root collection. This affects all use cases that default to the root collection if no collectionId param is provided.
Which issue(s) this PR closes:
Related Dataverse PRs:
Special notes for your reviewer:
Suggestions on how to test this:
Visual inspection of the code, including the updated Readme for the use cases, and review of the tests that use the default root collection.
Is there a release notes update needed for this change?:
Additional documentation: