Getting create/update response consistent with internal API for external.
This commit is contained in:
parent
3dc7192113
commit
5a3ecc3095
|
@ -1787,19 +1787,14 @@ describe.each([
|
|||
user: null,
|
||||
users: null,
|
||||
})
|
||||
const toCompare: any = {
|
||||
expect(updatedRow).toEqual({
|
||||
name: rowData.name,
|
||||
description: rowData.description,
|
||||
tableId,
|
||||
_id: row._id,
|
||||
_rev: expect.any(String),
|
||||
type: "row",
|
||||
}
|
||||
if (!isInternal) {
|
||||
toCompare.user = null
|
||||
toCompare.users = null
|
||||
}
|
||||
expect(updatedRow).toEqual(toCompare)
|
||||
})
|
||||
})
|
||||
|
||||
it("fetch all will populate the relationships", async () => {
|
||||
|
|
|
@ -250,6 +250,14 @@ export async function outputProcessing<T extends Row[] | Row>(
|
|||
enriched
|
||||
)) as Row[]
|
||||
}
|
||||
// remove null properties to match internal API
|
||||
for (let row of enriched) {
|
||||
for (let key of Object.keys(row)) {
|
||||
if (row[key] === null) {
|
||||
delete row[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
return (wasArray ? enriched : enriched[0]) as T
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue