Skip to content

Commit

Permalink
Bugfix/apply 1233 changes to applications list (#1232)
Browse files Browse the repository at this point in the history
  • Loading branch information
HalcyonJAC authored Oct 21, 2024
1 parent babdc16 commit b916f93
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions functions/actions/exercises/onUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ export default (config, firebase, db, auth) => {
const isDraftOrReady = dataAfter.state === 'draft' || dataAfter.state === 'ready';
const isPreviouslyApproved = objectHasNestedProperty(dataAfter, '_approval.initialApprovalDate');
const isUnlocked = isDraftOrReady && isPreviouslyApproved;
const canPostWithoutApproval = ['listing'].includes(dataAfter.advertType);
const canPostWithoutApproval = ['listing'].includes(dataAfter.advertType);
const isPublishedChanged = dataBefore.published !== dataAfter.published;

if (!isUnlocked || canPostWithoutApproval) {
if (!isUnlocked || canPostWithoutApproval || isPublishedChanged) {
// Update the vacancy if the exercise is published but not in the unlocked state (as the changes will need approval first)
await updateVacancy(exerciseId, dataAfter);
}
Expand Down

0 comments on commit b916f93

Please sign in to comment.