示例#1
0
        public async Task <IActionResult> PostAlertsAsync(string taskId, [FromBody] AlertTime alert)
        {
            try
            {
                alert.UserId = UserId;
                await _taskService.AddAlertAsync(taskId, alert).ConfigureAwait(false);

                return(Ok());
            }
            catch (NoDatabaseObjectFoundException e)
            {
                return(NotFound(e.Message));
            }
            catch (DatabaseUpdateException e)
            {
                return(BadRequest(e.Message));
            }
            catch (ArgumentException e)
            {
                return(BadRequest(e.Message));
            }
        }