feat(gitea): require a reason when the team refuses an application
CI / quality (push) Failing after 58s

A refusal without a reason leaves the member guessing why, which makes the
recruitment feel arbitrary. The reject button now opens a modal, the reason is
stored with the application, added to the review message and sent verbatim in
the DM; when the DM cannot be delivered, the team gets it back to pass along.
This commit is contained in:
BlackAngelTV committed 2026-12-06 17:18:11 +01:00
1 parent 6f3ec439d4
commit 9b45c9bf89
4 files changed
+122 -22

No files matched your search

@@ -0,0 +1,6 @@
-- Reason shown to the applicant when the team refuses an application.
--
-- A refusal without a reason reads as a rejection of the person; the team writes
-- one sentence and the bot forwards it verbatim in the DM.
ALTER TABLE gitea_applications ADD COLUMN rejection_reason TEXT;
@@ -84,14 +84,14 @@ export function releaseApplication(id) {
.run(id).changes;
}
export function rejectApplication(id, reviewerId) {
export function rejectApplication(id, reviewerId, reason = null) {
return getDatabase()
.prepare(
`UPDATE gitea_applications
SET status = 'rejected', reviewed_by = ?, reviewed_at = datetime('now')
SET status = 'rejected', reviewed_by = ?, reviewed_at = datetime('now'), rejection_reason = ?
WHERE id = ? AND status = 'pending'`,
)
.run(reviewerId, id).changes;
.run(reviewerId, reason, id).changes;
}
export function setApplicationGiteaUser(id, giteaUserId) {