public IActionResult CreateCashier(CashierCreateRequest request) { if (!ModelState.IsValid) { return(BadRequest()); } _cashierRepository.CreateCashier(request); return(Ok()); }
public IActionResult CreateCashier(string username, string password) { try { _cashierRepository.CreateCashier(username, password); return(Ok()); } catch (Exception) { return(BadRequest()); } }
public IActionResult RegisterCashier([FromBody] Cashier cashier) { try { var user = _cashierRepository.CreateCashier(cashier.Username, cashier.Password); return(Ok(new { id = user.Id, username = user.Username, token = _jwtHelper.GetJwtToken(user) })); } catch (Exception) { return(BadRequest()); } }