Fork me on GitHub
#yada
<
2018-03-16
>
johnswanson16:03:36

hey, i have a noob question about yada (and REST, i guess): i'd like to allow people to create users via a POST request, but usernames/email addresses must be unique. what's the best place to specify that uniqueness restriction? right now i'm just manually updating the response status to 409 in the :response function, but is there a better way to specify constraints like these?

mccraigmccraig16:03:37

409 and some description of the error in the body which your client can use to present an error seems reasonable @slack1097

johnswanson16:03:33

alright, thank you!

johnswanson16:03:58

just wanted to make sure there wasn't a "standard" way to declare restrictions like that 🙂

mccraigmccraig16:03:11

nothing i'm aware of anyway 😬