public async Task <ActionResult> UpdateSecurityQuestion([FromBody] UpdateSecurityQuestionReqModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(new ErrorModel {
                    Message = string.Join(",", ModelState.Values.SelectMany(v => v.Errors))
                }));
            }


            var res = await _authService.UpdateSecurityQuestion(model, _authHelpers.GetCurrentUserId());

            return(StatusCode(res.GetStatusCode(), res.Result));
        }
        public async Task <ActionResult> Get([FromRoute] long locationId, [FromQuery] KeyholderSearchReqModel model)
        {
            var res = await _keyHolderService.SearchKeyholder(locationId, _authHelpers.GetCurrentUserId().Value, model);

            return(StatusCode(res.GetStatusCode(), res.Result));
        }
Beispiel #3
0
 public async Task <ActionResult> Get([FromRoute] long locationId, [FromQuery] AdminSearchReqModel model)
 {
     return(Ok(await _adminService.SearchAdmin(locationId, _authHelpers.GetCurrentUserId().Value, model)));
 }
        public async Task <ActionResult> Get([FromRoute][Required] long locationId, [FromQuery] string keySerialNumber, [FromQuery] string deviceSerialNumber)
        {
            var res = await _authenticationCodeService.GetCode(locationId, _authHelpers.GetCurrentUserId().Value, keySerialNumber, deviceSerialNumber);

            return(StatusCode(res.GetStatusCode(), res.Result));
        }
        public async Task <ActionResult> SaveStatuses([FromRoute][Required] long locationId, [FromQuery][BindRequired] string type, [FromBody] ConfigStatusReqModel model)
        {
            var res = await _configService.SaveStatuse(locationId, _authHelpers.GetCurrentUserId().Value, type, model);

            return(StatusCode(res.GetStatusCode(), res.Result));
        }
Beispiel #6
0
        public async Task <ActionResult> GetProfile([FromRoute] long locationId)
        {
            var res = await _accountService.GetAdminProfile(locationId, _authHelpers.GetCurrentUserId().Value);

            return(StatusCode(res.GetStatusCode(), res.Result));
        }