allow root as parent
This commit is contained in:
@@ -22,7 +22,7 @@ export class UmbSortChildrenOfDocumentRepository extends UmbControllerBase imple
|
||||
}
|
||||
|
||||
async sortChildrenOf(args: UmbSortChildrenOfArgs) {
|
||||
if (!args.unique) throw new Error('Unique is missing');
|
||||
if (args.unique === undefined) throw new Error('Unique is missing');
|
||||
if (!args.sorting) throw new Error('Sorting details are missing');
|
||||
|
||||
const { error } = await this.#dataSource.sortChildrenOf(args);
|
||||
|
||||
@@ -27,7 +27,7 @@ export class UmbSortChildrenOfDocumentServerDataSource {
|
||||
* @memberof UmbSortChildrenOfDocumentServerDataSource
|
||||
*/
|
||||
async sortChildrenOf(args: UmbSortChildrenOfArgs) {
|
||||
if (!args.unique) throw new Error('unique is missing');
|
||||
if (args.unique === undefined) throw new Error('unique is missing');
|
||||
|
||||
const sortingMapping = args.sorting.map((item) => ({ id: item.unique, sortOrder: item.sortOrder }));
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export interface UmbSortChildrenOfArgs {
|
||||
unique: string;
|
||||
unique: string | null;
|
||||
sorting: Array<{ unique: string; sortOrder: number }>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user