chore: remove API v1

This commit is contained in:
spiral
2022-04-20 12:20:03 -04:00
parent 1e86c2d6c4
commit 7aaad288e6
29 changed files with 136 additions and 808 deletions

View File

@@ -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")]