File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 7373 <Input
7474 type =" number"
7575 v-model =" selected[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n]"
76- class =" w-full "
76+ class =" w-full min-w-[80px] "
7777 :fullWidth =" true"
7878 />
7979 </div >
Original file line number Diff line number Diff line change @@ -387,6 +387,35 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
387387 }
388388 }
389389 }
390+ try {
391+ const AuditLogPlugin = this . adminforth . getPluginByClassName ( 'AuditLogPlugin' ) ;
392+ if ( AuditLogPlugin ) {
393+
394+ for ( const [ key , value ] of Object . entries ( oldRecord ) ) {
395+ if ( ! ( key in fieldsToUpdate [ idx ] ) ) {
396+ delete oldRecord [ key ] ;
397+ }
398+ }
399+
400+ const reorderedOldRecord = Object . keys ( fieldsToUpdate [ idx ] ) . reduce ( ( acc , key ) => {
401+ if ( key in oldRecord ) {
402+ acc [ key ] = oldRecord [ key ] ;
403+ }
404+ return acc ;
405+ } , { } as Record < string , unknown > ) ;
406+
407+ AuditLogPlugin . logCustomAction ( {
408+ resourceId : this . resourceConfig . resourceId ,
409+ recordId : ID ,
410+ actionId : 'Bulk-ai-flow' ,
411+ oldData : reorderedOldRecord ,
412+ data : fieldsToUpdate [ idx ] ,
413+ user : adminUser ,
414+ headers : headers
415+ } ) ;
416+ }
417+ } catch ( error ) { }
418+
390419 return this . adminforth . resource ( this . resourceConfig . resourceId ) . update ( ID , fieldsToUpdate [ idx ] )
391420 } ) ;
392421 await Promise . all ( updates ) ;
You can’t perform that action at this time.
0 commit comments