public async Task <IActionResult> Delete([FromRoute] Guid lessonId) { var userOwnLesson = await _LessonService.UserOwnsLesson(lessonId, HttpContext.GetUserId()); if (!userOwnLesson) { return(BadRequest(new { error = "You do not own this lesson" })); } var deleted = await _LessonService.DeleteLesson(lessonId); if (deleted) { return(NoContent()); } return(NotFound()); }
public void DeleteLesson([FromQuery] int lessonId) { _service.DeleteLesson(lessonId); }
public async Task DeleteLesson([FromQuery] string id) { var model = await _lessonService.GetLessonById(id); await _lessonService.DeleteLesson(model); }
public async Task <string> DeleteLesson(int lessonId) { await lessonService.DeleteLesson(lessonId); return("Done!"); }