fix(web): allow cancelling pending applications; drop contradictory message guard
PR Checks / test-and-build (pull_request) Successful in 7m50s

Address review feedback from PR #119:

- LeaveClubMembershipAsync: was rejecting Pending rows because the SQL
  required status = 'Active', so clicking "Отозвать заявку" on a Pending
  membership surfaced a misleading "Active membership X not found"
  InvalidOperationException. Now the method first tries Active -> Left
  and falls back to Pending -> Rejected so the same UI flow covers both
  states.
- PublicClub.razor TrySubmitApplicationAsync: removed the empty-input
  guard that contradicted the "(необязательно)" label and the server
  side (AuthorizedMembershipService already trims and accepts null).

No tests broken (493 still passing), no public-API changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-03 11:33:28 +03:00
parent 6cb2fbe610
commit 22e9859fdf
2 changed files with 16 additions and 8 deletions
@@ -167,12 +167,6 @@ else if (club is not null)
if (club is null)
return;
if (string.IsNullOrWhiteSpace(applicationMessage))
{
applicationError = "Введите сообщение или оставьте поле пустым.";
return;
}
try
{
isSubmittingApplication = true;