@@ -43,7 +43,7 @@ export class BackendsService extends AbstractQueueProcessor {
4343 { new : true } ,
4444 ) ;
4545 if ( isSyncedJob ) {
46- await this . identitiesService . model . findByIdAndUpdate ( isSyncedJob . concernedTo , {
46+ await this . identitiesService . model . findByIdAndUpdate ( isSyncedJob . concernedTo . id , {
4747 $set : {
4848 state : IdentityState . SYNCED ,
4949 } ,
@@ -80,7 +80,7 @@ export class BackendsService extends AbstractQueueProcessor {
8080 } ,
8181 { new : true } ,
8282 ) ;
83- await this . identitiesService . model . findByIdAndUpdate ( failedJob . concernedTo , {
83+ await this . identitiesService . model . findByIdAndUpdate ( failedJob . concernedTo . id , {
8484 $set : {
8585 state : IdentityState . ON_ERROR ,
8686 } ,
@@ -99,7 +99,7 @@ export class BackendsService extends AbstractQueueProcessor {
9999 } ,
100100 { upsert : true , new : true } ,
101101 ) ;
102- await this . identitiesService . model . findByIdAndUpdate ( completedJob . concernedTo , {
102+ await this . identitiesService . model . findByIdAndUpdate ( completedJob . concernedTo . id , {
103103 $set : {
104104 state : IdentityState . SYNCED ,
105105 } ,
@@ -202,11 +202,16 @@ export class BackendsService extends AbstractQueueProcessor {
202202 optionals [ 'processedAt' ] = new Date ( ) ;
203203 optionals [ 'state' ] = JobState . IN_PROGRESS ;
204204 }
205+ const identity = await this . identitiesService . findById < Identities > ( concernedTo ) ;
205206 const jobStore = await this . jobsService . create < Jobs > ( {
206207 jobId : job . id ,
207208 action : actionType ,
208209 params : payload ,
209- concernedTo : concernedTo ,
210+ concernedTo : {
211+ $ref : 'identities' ,
212+ id : concernedTo ,
213+ name : [ identity . inetOrgPerson ?. cn , identity . inetOrgPerson ?. givenName ] . join ( ' ' ) ,
214+ } ,
210215 comment : options ?. comment ,
211216 task : options ?. task ,
212217 state : JobState . CREATED ,
0 commit comments