Allow photos with future timestamps (#293)

Set the timestamp to the current time instead of returning 400.
This commit is contained in:
Josh 2022-04-26 11:41:42 -05:00 committed by GitHub
commit 81993214bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();
}
}
}