Allow up to 5 suggestions per player
This commit is contained in:
@@ -74,9 +74,9 @@ public static class SuggestEndpoints
|
|||||||
}
|
}
|
||||||
|
|
||||||
var existingCount = await db.Suggestions.CountAsync(s => s.PlayerId == player.Id);
|
var existingCount = await db.Suggestions.CountAsync(s => s.PlayerId == player.Id);
|
||||||
if (existingCount >= 3)
|
if (existingCount >= 5)
|
||||||
{
|
{
|
||||||
return Results.BadRequest(new { error = "You have reached the 3 suggestion limit." });
|
return Results.BadRequest(new { error = "You have reached the 5 suggestion limit." });
|
||||||
}
|
}
|
||||||
|
|
||||||
var suggestion = new Suggestion
|
var suggestion = new Suggestion
|
||||||
|
|||||||
Reference in New Issue
Block a user