flex sign up in the bot is now also only possible if the user is already signed up

This commit is contained in:
Sarah Faey 2022-12-03 14:01:25 +01:00
parent 19595e52bf
commit 766faf7b66
3 changed files with 37 additions and 3 deletions

View file

@ -47,6 +47,14 @@ namespace Lieb.Controllers
return Ok();
}
[HttpGet]
[Route("[action]/{raidId}/{userId}")]
public bool IsUserSignedUp(int raidId, ulong userId)
{
Raid raid = _raidService.GetRaid(raidId);
return raid.SignUps.Where(s => s.LiebUserId == userId && s.SignUpType != SignUpType.Flex && s.SignUpType != SignUpType.SignedOff).Any();
}
[HttpGet]
[Route("[action]/{raidId}")]
public ActionResult IsExternalSignUpAllowed(int raidId)