File tree Expand file tree Collapse file tree 1 file changed +24
-3
lines changed
src/packages/user/user/repository/detail Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Original file line number Diff line number Diff line change 1
- import type { UmbUserDetailModel } from '../../types.js' ;
1
+ import type { UmbUserDetailModel , UmbUserStartNodesModel } from '../../types.js' ;
2
2
import { UMB_USER_ENTITY_TYPE } from '../../entity.js' ;
3
3
import { UmbId } from '@umbraco-cms/backoffice/id' ;
4
4
import type { UmbDetailDataSource } from '@umbraco-cms/backoffice/repository' ;
@@ -219,14 +219,35 @@ export class UmbUserServerDataSource implements UmbDetailDataSource<UmbUserDetai
219
219
* @return {* }
220
220
* @memberof UmbUserServerDataSource
221
221
*/
222
- calculateStartNodes ( unique : string ) {
222
+ async calculateStartNodes ( unique : string ) {
223
223
if ( ! unique ) throw new Error ( 'Unique is missing' ) ;
224
224
225
- return tryExecuteAndNotify (
225
+ const { data , error } = await tryExecuteAndNotify (
226
226
this . #host,
227
227
UserService . getUserByIdCalculateStartNodes ( {
228
228
id : unique ,
229
229
} ) ,
230
230
) ;
231
+
232
+ if ( data ) {
233
+ const calculatedStartNodes : UmbUserStartNodesModel = {
234
+ hasDocumentRootAccess : data . hasDocumentRootAccess ,
235
+ documentStartNodeUniques : data . documentStartNodeIds . map ( ( node ) => {
236
+ return {
237
+ unique : node . id ,
238
+ } ;
239
+ } ) ,
240
+ hasMediaRootAccess : data . hasMediaRootAccess ,
241
+ mediaStartNodeUniques : data . mediaStartNodeIds . map ( ( node ) => {
242
+ return {
243
+ unique : node . id ,
244
+ } ;
245
+ } ) ,
246
+ } ;
247
+
248
+ return calculatedStartNodes ;
249
+ }
250
+
251
+ return { error } ;
231
252
}
232
253
}
You can’t perform that action at this time.
0 commit comments