Skip to content

Commit

Permalink
Reject build submissions updating status to approved
Browse files Browse the repository at this point in the history
  • Loading branch information
Pabl0cks committed Jun 20, 2024
1 parent b5bb3ed commit a0035fc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/nextjs/services/database/grants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ export const reviewGrant = async ({ grantId, action, txHash, txChainId, note }:
// Prepare the data to update based on the action
const updateData: Partial<GrantData> = { status: action };

// Reject build submission moving back to APPROVED status
const grantSnapshot = await getGrantSnapshotById(grantId);
const currentStatus = grantSnapshot.data()?.status;
if (currentStatus === PROPOSAL_STATUS.SUBMITTED && action === PROPOSAL_STATUS.REJECTED) {
updateData.status = PROPOSAL_STATUS.APPROVED;
}

if (note !== undefined) {
updateData.note = note;
}
Expand Down

0 comments on commit a0035fc

Please sign in to comment.