Making table required.
This commit is contained in:
parent
ccb56c8788
commit
8b0fc5ed5d
|
@ -437,7 +437,7 @@ export class ExternalRequest<T extends Operation> {
|
|||
// if we're creating (in a through table) need to wipe the existing ones first
|
||||
const promises = []
|
||||
const related = await this.lookupRelations(mainTableId, row)
|
||||
const table = this.getTable(mainTableId)
|
||||
const table = this.getTable(mainTableId)!
|
||||
for (let relationship of relationships) {
|
||||
const { key, tableId, isUpdate, id, ...rest } = relationship
|
||||
const body: { [key: string]: any } = processObjectSync(rest, row, {})
|
||||
|
|
|
@ -22,6 +22,7 @@ export async function makeTableRequest(
|
|||
operation,
|
||||
},
|
||||
meta: {
|
||||
table,
|
||||
tables,
|
||||
},
|
||||
table,
|
||||
|
|
|
@ -756,7 +756,7 @@ describe.each(
|
|||
},
|
||||
},
|
||||
meta: {
|
||||
table: config.table,
|
||||
table: config.table!,
|
||||
},
|
||||
})
|
||||
expect(res).toHaveLength(1)
|
||||
|
|
|
@ -66,7 +66,15 @@ function generateUpdateJson({
|
|||
body = {},
|
||||
filters = {},
|
||||
meta = {},
|
||||
}: {
|
||||
table: string
|
||||
body?: any
|
||||
filters?: any
|
||||
meta?: any
|
||||
}): QueryJson {
|
||||
if (!meta.table) {
|
||||
meta.table = table
|
||||
}
|
||||
return {
|
||||
endpoint: endpoint(table, "UPDATE"),
|
||||
filters,
|
||||
|
|
|
@ -91,7 +91,7 @@ export interface QueryJson {
|
|||
body?: Row | Row[]
|
||||
table?: Table
|
||||
meta: {
|
||||
table?: Table
|
||||
table: Table
|
||||
tables?: Record<string, Table>
|
||||
renamed?: RenameColumn
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue