File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -803,6 +803,7 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
803803 }
804804 }
805805 const primaryKeyColumn = this . resourceConfig . columns . find ( ( col ) => col . primaryKey ) ;
806+ const decimalFieldsArray = this . resourceConfig . columns . filter ( c => c . type === 'decimal' ) . map ( c => c . name ) ;
806807 const updates = selectedIds . map ( async ( ID , idx ) => {
807808 const oldRecord = await this . adminforth . resource ( this . resourceConfig . resourceId ) . get ( [ Filters . EQ ( primaryKeyColumn . name , ID ) ] ) ;
808809 for ( const [ key , value ] of Object . entries ( outputImageFields ) ) {
@@ -837,6 +838,15 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
837838 }
838839 }
839840 }
841+
842+ // Convert decimal fields to numbers
843+ if ( decimalFieldsArray . length > 0 ) {
844+ for ( const fieldName of decimalFieldsArray ) {
845+ if ( fieldsToUpdate [ idx ] . hasOwnProperty ( fieldName ) ) {
846+ fieldsToUpdate [ idx ] [ fieldName ] = `${ fieldsToUpdate [ idx ] [ fieldName ] } ` ;
847+ }
848+ }
849+ }
840850 const newRecord = {
841851 ...oldRecord ,
842852 ...fieldsToUpdate [ idx ]
You can’t perform that action at this time.
0 commit comments