Fix row types
This commit is contained in:
parent
2526997b47
commit
8009ee7ec9
|
@ -31,7 +31,8 @@ export const createActions = (context: StoreContext): TableActions => {
|
|||
...row,
|
||||
tableId: get(datasource)?.tableId,
|
||||
}
|
||||
return await API.saveRow(row, SuppressErrors)
|
||||
const newRow = await API.saveRow(row, SuppressErrors)
|
||||
return { ...newRow, _id: newRow._id! }
|
||||
}
|
||||
|
||||
const deleteRows = async (rows: Row[]) => {
|
||||
|
@ -52,7 +53,12 @@ export const createActions = (context: StoreContext): TableActions => {
|
|||
},
|
||||
paginate: false,
|
||||
})
|
||||
return res?.rows?.[0]
|
||||
const row = res?.rows?.[0]
|
||||
if (!row) {
|
||||
return
|
||||
}
|
||||
|
||||
return { ...row, _id: row._id! }
|
||||
}
|
||||
|
||||
const canUseColumn = (name: string) => {
|
||||
|
|
|
@ -34,8 +34,10 @@ export const createActions = (context: StoreContext): ViewActions => {
|
|||
tableId: $datasource?.tableId,
|
||||
_viewId: $datasource?.id,
|
||||
}
|
||||
const newRow = await API.saveRow(row, SuppressErrors)
|
||||
return {
|
||||
...(await API.saveRow(row, SuppressErrors)),
|
||||
...newRow,
|
||||
_id: newRow._id!,
|
||||
_viewId: row._viewId,
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +56,12 @@ export const createActions = (context: StoreContext): ViewActions => {
|
|||
},
|
||||
paginate: false,
|
||||
})
|
||||
return res?.rows?.[0]
|
||||
const row = res?.rows?.[0]
|
||||
if (!row) {
|
||||
return
|
||||
}
|
||||
|
||||
return { ...row, _id: row._id! }
|
||||
}
|
||||
|
||||
const isDatasourceValid = (datasource: UIDatasource) => {
|
||||
|
|
Loading…
Reference in New Issue