Skip to content

Commit ec83caa

Browse files
committed
Fix tasks order in batch update return
Also return creation date of the task
1 parent 2464954 commit ec83caa

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

RequestTests.paw

-84 Bytes
Binary file not shown.

src/SimpleToDoService/Controllers/TasksController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ private async System.Threading.Tasks.Task<Task> UpdateTask(Task task)
163163
if (updated == null)
164164
return null;
165165

166-
var reloaded = repository.Task(CurrentUserUuid, task.Uuid);
166+
var reloaded = repository.ReloadTask(updated);
167167

168168
await new PushNotificationScheduler(repository).SchedulePushNotifications(reloaded);
169169

src/SimpleToDoService/Database/Entities.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ public class Task
6969
[MaxLength(4000)]
7070
public string Notes { get; set; }
7171

72-
[XmlIgnore]
73-
[JsonIgnore]
74-
[IgnoreDataMember]
7572
[Column("creationdate")]
7673
public DateTime CreationDate { get; set; }
7774

src/SimpleToDoService/Database/Repositiory.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public interface IToDoRepository
1313
User User(Guid uuid);
1414
IEnumerable<Task> Tasks(Guid userUuid);
1515
Task Task(Guid userUuid, Guid taskUuid);
16+
Task ReloadTask(Task task);
1617
Task CreateTask(Task task);
1718
Task UpdateTask(Task task);
1819
bool DeleteTask(Guid uuid);
@@ -52,6 +53,12 @@ public Task Task(Guid userUuid, Guid entryUuid)
5253
.FirstOrDefault();
5354
}
5455

56+
public Task ReloadTask(Task task)
57+
{
58+
context.Entry(task).State = EntityState.Detached;
59+
return Task(task.UserUuid, task.Uuid);
60+
}
61+
5562
public Task CreateTask(Task task)
5663
{
5764
task.Uuid = new Guid();

0 commit comments

Comments
 (0)