public async Task <IActionResult> Delete(string id) { if (string.IsNullOrEmpty(id)) { throw new ValidationApiException(ApiErrorCode.MissingInformation, $"Parameter {nameof(id)} must be provided."); } await _itemsService.DeleteItemAsync(id); return(Ok()); }
public async Task <IActionResult> Delete(string id) { if (string.IsNullOrWhiteSpace(id)) { return(NotFound()); } var userId = User.FindFirst(ClaimTypes.NameIdentifier).Value; var plan = await _itemsService.DeleteItemAsync(id, userId); if (plan == null) { return(NotFound()); } return(Ok(new OperationResponse <ToDoItem> { IsSuccess = true, Message = "Item deleted successfully!", Record = plan })); }
public async Task <IActionResult> Delete(string id) { var result = await _itemsService.DeleteItemAsync(id, UserId); return(Ok(result.Message)); }
public async Task DeleteItem(int id) { await _itemsService.DeleteItemAsync(id); }
public async Task <IActionResult> DeleteConfirmed(string id) { await service.DeleteItemAsync(id); return(RedirectToAction(nameof(Index))); }