fix: correctly parse member data as v2 model in POST /members

This commit is contained in:
spiral
2021-11-28 07:20:35 -05:00
parent 99a9ec7928
commit 6919d10953

View File

@@ -43,7 +43,7 @@ public class MemberControllerV2: PKControllerBase
if (memberCount >= memberLimit)
throw Errors.MemberLimitReached;
var patch = MemberPatch.FromJSON(data);
var patch = MemberPatch.FromJSON(data, APIVersion.V2);
patch.AssertIsValid();
if (!patch.Name.IsPresent)
patch.Errors.Add(new ValidationError("name", "Key 'name' is required when creating new member."));