1
0
Fork 0
mirror of synced 2024-09-20 11:27:56 +12:00

Handle reordering

This commit is contained in:
Adria Navarro 2024-09-09 13:44:06 +02:00
parent 332bc3d23c
commit 9dd6767e4e

View file

@ -214,11 +214,20 @@ export const createActions = context => {
})
// Extract new orders as schema mutations
let mutations = {}
get(columns).forEach((column, idx) => {
mutations[column.name] = { order: idx }
const { related } = column
const mutation = { order: idx }
if (!related) {
datasource.actions.addSchemaMutation(column.name, mutation)
} else {
datasource.actions.addSubSchemaMutation(
related.subField,
related.field,
mutation
)
}
})
datasource.actions.addSchemaMutations(mutations)
await datasource.actions.saveSchemaMutations()
}