Skip to content

Commit cdf8e15

Browse files
alxndrsnspwoodcock
authored andcommitted
refactor: Entities: inline getEntitiesState() inner function (getodk#1428)
1 parent 526c374 commit cdf8e15

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/model/query/entities.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ const idFilter = (options) => {
972972
return query.sql ? query : sql`TRUE`;
973973
};
974974

975-
const _getAllEntitiesState = (datasetId, options) => sql`
975+
const getEntitiesState = (datasetId, options = QueryOptions.none) => ({ all }) => all(sql`
976976
SELECT uuid, "deletedAt" IS NOT NULL as deleted
977977
FROM entities
978978
WHERE "datasetId" = ${datasetId}
@@ -987,10 +987,7 @@ const _getAllEntitiesState = (datasetId, options) => sql`
987987
) purged
988988
WHERE ${idFilter(options)}
989989
-- union with not approved
990-
`;
991-
992-
const getEntitiesState = (datasetId, options = QueryOptions.none) =>
993-
({ all }) => all(_getAllEntitiesState(datasetId, options));
990+
`);
994991

995992
module.exports = {
996993
createNew, _processSubmissionEvent,

0 commit comments

Comments
 (0)