diff --git a/app/src/api/dataAccess/__mocks__/editHistory.ts b/app/src/api/dataAccess/__mocks__/editHistory.ts index 7c2320b7..735e71c1 100644 --- a/app/src/api/dataAccess/__mocks__/editHistory.ts +++ b/app/src/api/dataAccess/__mocks__/editHistory.ts @@ -18,7 +18,7 @@ mockEditHistory.__setHistory = function(mockHistoryData: EditHistoryEntry[]) { }; function hasDeletions(json) { - return Object.values(json).some(x => x === null || (Array.isArray(x) && x.length === 0)) + return Object.values(json).some(x => x === null); } mockEditHistory.getHistoryAfterId = function(id: string, count: number, filterDeletions: boolean): Promise { diff --git a/app/src/api/dataAccess/editHistory.ts b/app/src/api/dataAccess/editHistory.ts index 215c3bb4..eba1cfa1 100644 --- a/app/src/api/dataAccess/editHistory.ts +++ b/app/src/api/dataAccess/editHistory.ts @@ -14,7 +14,7 @@ const baseQuery = ` JOIN users ON logs.user_id = users.user_id`; const deletionCondition = ` - EXISTS (SELECT * from jsonb_each(forward_patch) WHERE value IN ('null', '[]')) + EXISTS (SELECT * from jsonb_each(forward_patch) WHERE value = 'null' ) `; export function getHistoryAfterId(id: string, count: number, filterDeletions: boolean = false): Promise {