@@ -172,17 +172,16 @@ export class EngagementService {
172
172
) ) as UnsecuredDto < LanguageEngagement > ;
173
173
const object = this . secure ( previous , session ) ;
174
174
175
- if ( input . status && input . status !== previous . status ) {
175
+ const { methodology, ...maybeChanges } = input ;
176
+ const changes = this . repo . getActualLanguageChanges ( object , maybeChanges ) ;
177
+ if ( changes . status ) {
176
178
await this . engagementRules . verifyStatusChange (
177
179
input . id ,
178
180
session ,
179
- input . status ,
181
+ changes . status ,
180
182
changeset ,
181
183
) ;
182
184
}
183
-
184
- const { methodology, ...maybeChanges } = input ;
185
- const changes = this . repo . getActualLanguageChanges ( object , maybeChanges ) ;
186
185
this . privileges
187
186
. for ( session , LanguageEngagement , object )
188
187
. verifyChanges ( changes ) ;
@@ -226,16 +225,15 @@ export class EngagementService {
226
225
) ) as UnsecuredDto < InternshipEngagement > ;
227
226
const object = this . secure ( previous , session ) ;
228
227
229
- if ( input . status && input . status !== previous . status ) {
228
+ const changes = this . repo . getActualInternshipChanges ( object , input ) ;
229
+ if ( changes . status ) {
230
230
await this . engagementRules . verifyStatusChange (
231
231
input . id ,
232
232
session ,
233
- input . status ,
233
+ changes . status ,
234
234
changeset ,
235
235
) ;
236
236
}
237
-
238
- const changes = this . repo . getActualInternshipChanges ( object , input ) ;
239
237
this . privileges
240
238
. for ( session , InternshipEngagement , object )
241
239
. verifyChanges ( changes , { pathPrefix : 'engagement' } ) ;
0 commit comments