File tree Expand file tree Collapse file tree
packages/updatePrescriptionStatus/src/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -233,11 +233,9 @@ export async function pushPrescriptionToNotificationSQS(
233233 // we don't want items that have gone from "ready to collect" to "ready to collect"
234234 // So chuck those out.
235235 const changedStatus = candidates
236- // In this check, don't consider previous updates that have a defined PostDatedLastModifiedSetAt
237- // This is because if the last one was post-dated, and the current one ISN'T, we DO want to send a notification
238- . filter ( item => item . previous ?. PostDatedLastModifiedSetAt === undefined )
239236 . filter ( ( { current, previous} ) => {
240237 if ( ! previous ) return true // no previous item (or hit an error getting one) -> treat as changed
238+ if ( previous . PostDatedLastModifiedSetAt ) return true // previous was post-dated -> treat as changed
241239 return norm ( current . Status ) !== norm ( previous . Status )
242240 } )
243241 . map ( ( { current} ) => current )
You can’t perform that action at this time.
0 commit comments