feat(apiv2): post/patch endpoints

This commit is contained in:
spiral
2021-10-14 09:35:20 -04:00
parent fd49e7e4ea
commit e367ed6808
4 changed files with 83 additions and 29 deletions

View File

@@ -165,8 +165,7 @@ namespace PluralKit.API
var valueStr = data.Value<string>("timestamp").NullIfEmpty();
if (valueStr == null)
// todo
throw Errors.GenericBadRequest;
throw new ModelParseError(new List<ValidationError>() { new ValidationError("timestamp", $"Key 'timestamp' is required.") });
var value = Instant.FromDateTimeOffset(DateTime.Parse(valueStr).ToUniversalTime());