mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-05 13:27:54 +00:00
chore: remove API v1
This commit is contained in:
parent
1e86c2d6c4
commit
7aaad288e6
29 changed files with 136 additions and 808 deletions
|
|
@ -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")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue