Fix tests
This commit is contained in:
parent
ceb3129e22
commit
6bae382d81
|
@ -78,9 +78,9 @@ export async function save(ctx: UserCtx<SaveTableRequest, SaveTableResponse>) {
|
|||
ctx.status = 200
|
||||
ctx.message = `Table ${table.name} saved successfully.`
|
||||
ctx.eventEmitter &&
|
||||
ctx.eventEmitter.emitTable(`table:save`, appId, savedTable)
|
||||
ctx.eventEmitter.emitTable(`table:save`, appId, { ...savedTable })
|
||||
ctx.body = savedTable
|
||||
builderSocket?.emitTableUpdate(ctx, savedTable)
|
||||
builderSocket?.emitTableUpdate(ctx, { ...savedTable })
|
||||
}
|
||||
|
||||
export async function destroy(ctx: UserCtx) {
|
||||
|
|
|
@ -557,6 +557,11 @@ class TestConfiguration {
|
|||
return this.updateTable(config, options)
|
||||
}
|
||||
|
||||
async getTable(tableId?: string) {
|
||||
tableId = tableId || this.table!._id!
|
||||
return this._req(null, { tableId }, controllers.table.find)
|
||||
}
|
||||
|
||||
async createLinkedTable(
|
||||
config?: Table,
|
||||
relationshipType = RelationshipType.ONE_TO_MANY,
|
||||
|
@ -607,6 +612,10 @@ class TestConfiguration {
|
|||
return this.api.row.save(tableId!, config)
|
||||
}
|
||||
|
||||
async getRow(tableId: string, rowId: string): Promise<Row> {
|
||||
return this._req(null, { tableId, rowId }, controllers.row.find)
|
||||
}
|
||||
|
||||
async getRows(tableId: string) {
|
||||
if (!tableId && this.table) {
|
||||
tableId = this.table._id!
|
||||
|
|
Loading…
Reference in New Issue