Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New POST /v1/user/update API endpoint #295

Open
sergeychernyshev opened this issue Feb 28, 2021 · 0 comments
Open

New POST /v1/user/update API endpoint #295

sergeychernyshev opened this issue Feb 28, 2021 · 0 comments
Labels

Comments

@sergeychernyshev
Copy link
Member

sergeychernyshev commented Feb 28, 2021

Create a new endpoint for updating user's info.

POST /v1/user/update

Parameters:

  • name - string (user’s name)
  • email - string (sets email change attempt, but requires email confirmation to update existing address before it is shown)

Returns no object if successful

Throws exceptions:

  • BadParameterException if name is empty
  • BadParameterException if email is invalid
  • UnauthorizedException if email is already taken

Existing form-based implementation can be found here:
https://github.com/StartupAPI/users/blob/master/edit.php#L53-L90

Move email validation into User::setEmail() and name validation into User::setName() methods instead of UI, create new validation exception classes and throw exceptions to catch in the UI and APIs. Update edit.php to also use same exceptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant