refactor(apiv2): rewrite group member endpoints to be cleaner

This commit is contained in:
spiral
2021-10-30 18:16:18 -04:00
parent 93eef82a83
commit c7126840ed
5 changed files with 208 additions and 159 deletions

View File

@@ -71,12 +71,14 @@ namespace PluralKit.API
public static PKError GenericAuthError = new(401, 0, "401: Missing or invalid Authorization header");
public static PKError SystemNotFound = new(404, 20001, "System not found.");
public static PKError MemberNotFound = new(404, 20002, "Member not found.");
public static PKError GroupNotFound = new(404, 20003, "Group not found.");
public static PKError MessageNotFound = new(404, 20004, "Message not found.");
public static PKError SwitchNotFound = new(404, 20005, "Switch not found.");
public static PKError SwitchNotFoundPublic = new(404, 20005, "Switch not found, switch associated with different system, or unauthorized to view front history.");
public static PKError SystemGuildNotFound = new(404, 20006, "No system guild settings found for target guild.");
public static PKError MemberGuildNotFound = new(404, 20007, "No member guild settings found for target guild.");
public static PKError MemberNotFoundWithRef(string memberRef) => new(404, 20003, $"Member '{memberRef}' not found.");
public static PKError GroupNotFound = new(404, 20004, "Group not found.");
public static PKError GroupNotFoundWithRef(string groupRef) => new(404, 20005, $"Group '{groupRef}' not found.");
public static PKError MessageNotFound = new(404, 20006, "Message not found.");
public static PKError SwitchNotFound = new(404, 20007, "Switch not found.");
public static PKError SwitchNotFoundPublic = new(404, 20008, "Switch not found, switch associated with different system, or unauthorized to view front history.");
public static PKError SystemGuildNotFound = new(404, 20009, "No system guild settings found for target guild.");
public static PKError MemberGuildNotFound = new(404, 20010, "No member guild settings found for target guild.");
public static PKError UnauthorizedMemberList = new(403, 30001, "Unauthorized to view member list");
public static PKError UnauthorizedGroupList = new(403, 30002, "Unauthorized to view group list");
public static PKError UnauthorizedGroupMemberList = new(403, 30003, "Unauthorized to view group member list");