1
0
Fork 0
mirror of synced 2024-07-30 18:46:00 +12:00

Rollback state changes when row saving fails

This commit is contained in:
Andrew Kingston 2023-03-30 08:52:43 +01:00
parent aaa0f1a7a0
commit 7ba064dd31

View file

@ -203,6 +203,12 @@ export const createRowsStore = context => {
await API.saveRow(newRow)
} catch (error) {
notifications.error(`Error saving row: ${error?.message}`)
// Revert change
rows.update(state => {
state[index] = row
return state
})
}
}