Untitled

 avatar
unknown
csharp
9 days ago
348 B
3
Indexable
[Authorize]
[HttpPost("find")]
public ActionResult<MenuOption> GetCart([FromBody] int id)
{
    if(User.FindFirst(ClaimTypes.Name) == null) return BadRequest("Claim is not found");

    MenuOption? foundOption = FindMenu(id);
    if(foundOption == null) {
        return BadRequest("No menu found");
    }

    return Ok(foundOption);
}
Editor is loading...
Leave a Comment