feat(jobs): allow users to withdraw job applications (Fixes #171)#317
Open
Ishant5436 wants to merge 8 commits into
Open
feat(jobs): allow users to withdraw job applications (Fixes #171)#317Ishant5436 wants to merge 8 commits into
Ishant5436 wants to merge 8 commits into
Conversation
…s (Issue algora-io#210) This secures the apply_job flow by checking if the candidate has 'candidates_require_confirmation' enabled. If so, it returns an error requiring email confirmation, which is also gracefully handled in the UI via a flash error.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Users currently have no option to withdraw a submitted job application. This PR adds:
Changes
Jobs.withdraw_application/2— New context function that hard-deletes a user's pending application for a given job. The existingunique_constraint([:job_id, :user_id])allows clean re-application after withdrawal.UI (jobs_live.ex) — Replaced the disabled 'Applied' button with a red 'Withdraw' button that calls the new
withdraw_jobLiveView event.Event handlers — Added
withdraw_jobhandlers in all three LiveViews (jobs_live,home_live,platform_live) with proper error handling and flash messages.Design Decision: Hard Delete vs Soft Delete
Chose hard delete (Repo.delete) over soft delete for simplicity:
[:pending]— adding:withdrawnwould require a migration