mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix(api): fix autoproxy mode check when patching member
This commit is contained in:
parent
5c0472eb95
commit
42905ba3bd
1 changed files with 4 additions and 1 deletions
|
|
@ -68,7 +68,10 @@ public class AutoproxyControllerV2: PKControllerBase
|
|||
patch.AssertIsValid();
|
||||
if (updateMember && member == null)
|
||||
patch.Errors.Add(new("autoproxy_member", "Member not found."));
|
||||
if (updateMember && ((patch.AutoproxyMode.IsPresent && patch.AutoproxyMode.Value == AutoproxyMode.Latch) || oldData.AutoproxyMode == AutoproxyMode.Latch))
|
||||
if (updateMember && !(
|
||||
(patch.AutoproxyMode.IsPresent && patch.AutoproxyMode.Value == AutoproxyMode.Member)
|
||||
|| (!patch.AutoproxyMode.IsPresent && oldData.AutoproxyMode == AutoproxyMode.Member))
|
||||
)
|
||||
patch.Errors.Add(new("autoproxy_member", "Cannot update autoproxy member if autoproxy mode is set to latch"));
|
||||
if (patch.Errors.Count > 0)
|
||||
throw new ModelParseError(patch.Errors);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue