Add Clear Queued Levels endpoint

Closes #43
This commit is contained in:
jvyden 2021-11-18 18:55:53 -05:00
commit 4542bd3313
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278

View file

@ -90,6 +90,19 @@ namespace LBPUnion.ProjectLighthouse.Controllers
return this.Ok();
}
[HttpPost("lolcatftw/clear")]
public async Task<IActionResult> ClearQueuedLevels()
{
User? user = await this.database.UserFromRequest(this.Request);
if (user == null) return this.StatusCode(403, "");
this.database.QueuedLevels.RemoveRange(this.database.QueuedLevels.Where(q => q.UserId == user.UserId));
await this.database.SaveChangesAsync();
return this.Ok();
}
#endregion
#region Hearted Levels