Don't return foreign keys on updates and deletes
This commit is contained in:
parent
29503d1244
commit
c87efb7866
|
@ -280,6 +280,7 @@ describe("row api - postgres", () => {
|
||||||
const res = await updateRow(postgresTable._id, updatedRow)
|
const res = await updateRow(postgresTable._id, updatedRow)
|
||||||
|
|
||||||
expect(res.status).toBe(200)
|
expect(res.status).toBe(200)
|
||||||
|
expect(res.body).toEqual(updatedRow)
|
||||||
|
|
||||||
const persistedRow = await config.getRow(postgresTable._id!, row.id)
|
const persistedRow = await config.getRow(postgresTable._id!, row.id)
|
||||||
|
|
||||||
|
|
|
@ -497,7 +497,9 @@ class InternalBuilder {
|
||||||
if (opts.disableReturning) {
|
if (opts.disableReturning) {
|
||||||
return query.update(parsedBody)
|
return query.update(parsedBody)
|
||||||
} else {
|
} else {
|
||||||
return query.update(parsedBody).returning("*")
|
return query
|
||||||
|
.update(parsedBody)
|
||||||
|
.returning(generateSelectStatement(json, knex, true))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -512,7 +514,7 @@ class InternalBuilder {
|
||||||
if (opts.disableReturning) {
|
if (opts.disableReturning) {
|
||||||
return query.delete()
|
return query.delete()
|
||||||
} else {
|
} else {
|
||||||
return query.delete().returning("*")
|
return query.delete().returning(generateSelectStatement(json, knex, true))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue