fix(developers): distinguish API errors from taken usernames in availability check
All checks were successful
Build and Deploy / deploy (push) Successful in 40s
All checks were successful
Build and Deploy / deploy (push) Successful in 40s
CheckUsernameAsync returned false (taken) on any API failure, making every username appear taken when SilverDESK was unreachable. Now returns nullable bool so errors show a warning instead of blocking submission. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,9 @@ public static class DeveloperEndpoints
|
||||
group.MapGet("/check-username/{username}", async (string username, DeveloperApplicationService service) =>
|
||||
{
|
||||
var available = await service.CheckUsernameAsync(username);
|
||||
return Results.Ok(new { available });
|
||||
if (available is null)
|
||||
return Results.Problem("Unable to verify username availability", statusCode: 503);
|
||||
return Results.Ok(new { available = available.Value });
|
||||
});
|
||||
|
||||
group.MapPost("/apply", async (DeveloperApplication application, DeveloperApplicationService service) =>
|
||||
|
||||
Reference in New Issue
Block a user