From 9a78b7c65429201e9b5844f2d54542f4e5c5545f Mon Sep 17 00:00:00 2001 From: Michael Taylor Date: Mon, 7 Feb 2022 07:29:18 -0500 Subject: [PATCH] fix: staging delete endpoint fix --- src/utils/data-assertions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/data-assertions.js b/src/utils/data-assertions.js index 87d74190..c453a19b 100644 --- a/src/utils/data-assertions.js +++ b/src/utils/data-assertions.js @@ -78,7 +78,8 @@ export const assertUnitRecordExists = async ( }; export const assertStagingRecordExists = async (stagingId) => { - const record = await Staging.findByPk(stagingId); + const record = await Staging.findOne({ where: { uuid: stagingId } }); + if (!record) { throw new Error( `The staging record for the staging ID: ${stagingId} does not exist.`,