Rollback state changes when row saving fails
This commit is contained in:
parent
aaa0f1a7a0
commit
7ba064dd31
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue