feat(backend): validate links, allow setting links in POST /users/@me/members
This commit is contained in:
parent
a3cbdc1a08
commit
8fe8755183
5 changed files with 37 additions and 5 deletions
|
@ -54,7 +54,8 @@ public class MembersController(
|
|||
("avatar", ValidationUtils.ValidateAvatar(req.Avatar)),
|
||||
.. ValidationUtils.ValidateFields(req.Fields, CurrentUser!.CustomPreferences),
|
||||
.. ValidationUtils.ValidateFieldEntries(req.Names?.ToArray(), CurrentUser!.CustomPreferences, "names"),
|
||||
.. ValidationUtils.ValidatePronouns(req.Pronouns?.ToArray(), CurrentUser!.CustomPreferences)
|
||||
.. ValidationUtils.ValidatePronouns(req.Pronouns?.ToArray(), CurrentUser!.CustomPreferences),
|
||||
.. ValidationUtils.ValidateLinks(req.Links)
|
||||
]);
|
||||
|
||||
var member = new Member
|
||||
|
@ -64,6 +65,7 @@ public class MembersController(
|
|||
Name = req.Name,
|
||||
DisplayName = req.DisplayName,
|
||||
Bio = req.Bio,
|
||||
Links = req.Links ?? [],
|
||||
Fields = req.Fields ?? [],
|
||||
Names = req.Names ?? [],
|
||||
Pronouns = req.Pronouns ?? [],
|
||||
|
@ -113,6 +115,7 @@ public class MembersController(
|
|||
string? Bio,
|
||||
string? Avatar,
|
||||
bool? Unlisted,
|
||||
string[]? Links,
|
||||
List<FieldEntry>? Names,
|
||||
List<Pronoun>? Pronouns,
|
||||
List<Field>? Fields);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue