File tree Expand file tree Collapse file tree 1 file changed +8
-19
lines changed
Service/GroupMembershipManagement/Hosts/WebApi/Services.WebApi Expand file tree Collapse file tree 1 file changed +8
-19
lines changed Original file line number Diff line number Diff line change @@ -49,28 +49,17 @@ protected override async Task<PostJobResponse> ExecuteCoreAsync(PostJobRequest r
4949 }
5050
5151 var destinationName = await _graphGroupRepository . GetGroupNameAsync ( destinationId ) ;
52- newSyncJobEntity . DestinationName = new DestinationName { Name = destinationName } ;
52+ var ownersDictionary = await _graphGroupRepository . GetDestinationOwnersAsync ( new List < Guid > { destinationId } ) ;
5353
54- var destinationIds = new List < Guid > { destinationId } ;
55- var ownersDictionary = await _graphGroupRepository . GetDestinationOwnersAsync ( destinationIds ) ;
56-
57- var destinationOwners = new List < DestinationOwner > ( ) ;
54+ var newSyncJobId = await _syncJobRepository . CreateSyncJobAsync ( newSyncJobEntity ) ;
5855
59- if ( ownersDictionary . TryGetValue ( destinationId , out List < Guid > ownerGuids ) )
56+ var destinationAttributes = new DestinationAttributes
6057 {
61- foreach ( var ownerGuid in ownerGuids )
62- {
63- var destinationOwner = new DestinationOwner
64- {
65- ObjectId = ownerGuid
66- } ;
67- destinationOwners . Add ( destinationOwner ) ;
68- }
69- }
70-
71- newSyncJobEntity . DestinationOwners = destinationOwners ;
72-
73- var newSyncJobId = await _syncJobRepository . CreateSyncJobAsync ( newSyncJobEntity ) ;
58+ Id = newSyncJobId ,
59+ Name = destinationName ,
60+ Owners = ownersDictionary . GetValueOrDefault ( destinationId )
61+ } ;
62+ await _destinationAttributesRepository . UpdateAttributes ( destinationAttributes ) ;
7463
7564 if ( newSyncJobId != Guid . Empty )
7665 {
You can’t perform that action at this time.
0 commit comments