From 81993214bf2545c82d6061a2d18e74cc5183ea34 Mon Sep 17 00:00:00 2001 From: Josh Date: Tue, 26 Apr 2022 11:41:42 -0500 Subject: [PATCH] Allow photos with future timestamps (#293) Set the timestamp to the current time instead of returning 400. --- .../Controllers/GameApi/Resources/PhotosController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ProjectLighthouse/Controllers/GameApi/Resources/PhotosController.cs b/ProjectLighthouse/Controllers/GameApi/Resources/PhotosController.cs index b4149f2a..aee276de 100644 --- a/ProjectLighthouse/Controllers/GameApi/Resources/PhotosController.cs +++ b/ProjectLighthouse/Controllers/GameApi/Resources/PhotosController.cs @@ -59,7 +59,7 @@ public class PhotosController : ControllerBase if (photo.Subjects.Count > 4) return this.BadRequest(); - if (photo.Timestamp > TimestampHelper.Timestamp) return this.BadRequest(); + if (photo.Timestamp > TimestampHelper.Timestamp) photo.Timestamp = TimestampHelper.Timestamp; foreach (PhotoSubject subject in photo.Subjects) { @@ -168,4 +168,4 @@ public class PhotosController : ControllerBase await this.database.SaveChangesAsync(); return this.Ok(); } -} \ No newline at end of file +}