From b2de057f46f2ba46edd9da2c14990f36e9ed86f2 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 28 Sep 2024 13:35:07 -0500 Subject: [PATCH] api - add synced user and date fields to submissions --- TASVideos.Api/Extensions/EntityExtensions.cs | 6 +++++- TASVideos.Api/Responses/SubmissionsResponse.cs | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/TASVideos.Api/Extensions/EntityExtensions.cs b/TASVideos.Api/Extensions/EntityExtensions.cs index 77cf4f139..224f970ee 100644 --- a/TASVideos.Api/Extensions/EntityExtensions.cs +++ b/TASVideos.Api/Extensions/EntityExtensions.cs @@ -112,7 +112,11 @@ public static IQueryable ToSubmissionsResponse(this IQuerya .OrderBy(a => a.Ordinal) .Select(a => a.Author!.UserName), AdditionalAuthors = s.AdditionalAuthors, - CreateTimestamp = s.CreateTimestamp + CreateTimestamp = s.CreateTimestamp, + SyncedOn = s.SyncedOn, + SyncedByUser = s.SyncedByUser != null + ? s.SyncedByUser.UserName + : null }); } } diff --git a/TASVideos.Api/Responses/SubmissionsResponse.cs b/TASVideos.Api/Responses/SubmissionsResponse.cs index 1ecc3f06d..bfcd0b914 100644 --- a/TASVideos.Api/Responses/SubmissionsResponse.cs +++ b/TASVideos.Api/Responses/SubmissionsResponse.cs @@ -73,4 +73,10 @@ internal class SubmissionsResponse [Sortable] public DateTime CreateTimestamp { get; init; } + + [Sortable] + public DateTime? SyncedOn { get; init; } + + [Sortable] + public string? SyncedByUser { get; init; } }