Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include label in get all task end point #126

Merged
merged 4 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion blotztask-api/Models/TaskItemDTO.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace BlotzTask.Models
using BlotzTask.Data.Entities;

PeterOu8 marked this conversation as resolved.
Show resolved Hide resolved
namespace BlotzTask.Models
{
public class TaskItemDTO
{
Expand All @@ -9,5 +11,6 @@ public class TaskItemDTO
public bool IsDone { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }
public Label Label { get; set; }
}
PeterOu8 marked this conversation as resolved.
Show resolved Hide resolved
}
4 changes: 3 additions & 1 deletion blotztask-api/Services/TaskService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@
{
return await _dbContext.TaskItems
.Where(x => x.UserId == userId)
.Include(x => x.Label)
.Select(x => new TaskItemDTO
{
Id = x.Id,
Title = x.Title
Title = x.Title,
Label = x.Label
PeterOu8 marked this conversation as resolved.
Show resolved Hide resolved
})
.ToListAsync();
}
catch (Exception ex)

Check warning on line 43 in blotztask-api/Services/TaskService.cs

View workflow job for this annotation

GitHub Actions / build-and-test-backend

The variable 'ex' is declared but never used
{
//TODO: Add some error log throw
throw;
Expand Down
Loading