chore: remove API v1
This commit is contained in:
@@ -17,7 +17,7 @@ public class SystemControllerV2: PKControllerBase
|
||||
{
|
||||
var system = await ResolveSystem(systemRef);
|
||||
if (system == null) throw Errors.SystemNotFound;
|
||||
return Ok(system.ToJson(ContextFor(system), APIVersion.V2));
|
||||
return Ok(system.ToJson(ContextFor(system)));
|
||||
}
|
||||
|
||||
[HttpPatch("{systemRef}")]
|
||||
@@ -27,14 +27,14 @@ public class SystemControllerV2: PKControllerBase
|
||||
if (system == null) throw Errors.SystemNotFound;
|
||||
if (ContextFor(system) != LookupContext.ByOwner)
|
||||
throw Errors.GenericMissingPermissions;
|
||||
var patch = SystemPatch.FromJSON(data, APIVersion.V2);
|
||||
var patch = SystemPatch.FromJSON(data);
|
||||
|
||||
patch.AssertIsValid();
|
||||
if (patch.Errors.Count > 0)
|
||||
throw new ModelParseError(patch.Errors);
|
||||
|
||||
var newSystem = await _repo.UpdateSystem(system.Id, patch);
|
||||
return Ok(newSystem.ToJson(LookupContext.ByOwner, APIVersion.V2));
|
||||
return Ok(newSystem.ToJson(LookupContext.ByOwner));
|
||||
}
|
||||
|
||||
[HttpGet("{systemRef}/settings")]
|
||||
|
||||
Reference in New Issue
Block a user