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

Add new /admin/users endpoint #589

Merged
merged 6 commits into from
Aug 7, 2024
Merged

Conversation

lfilmeyer
Copy link
Contributor

As discussed here:
https://cfb-public.slack.com/archives/C03TE14E3RP/p1721780510411939

we want to build a new endpoint POST /admin/users that will be used from the frontend on the /admin/user/createUser page. The endpoint should allow for creating users who are surveyors or admins.

POST /admin/users
{ 
	user: {
		email: "[email protected]",
		role: "surveyor",
		surveyor: {
			city: "Boston",
			firstname: "test",
			lastname: "test",
			phone: "1112223333",
			state: "MA",
			street_address: "1 Federal St",
			zipcode: "02110"
		}
	}
}

Response:

201 OK plus return the user playload

422 Unprocessable
{
	errors: {
		email: ["has already been taken"]
	}
}

@lfilmeyer lfilmeyer force-pushed the new-admin-create-user-endpoint branch from 2f4eab8 to f2ecd30 Compare August 5, 2024 15:01
Copy link
Collaborator

@aTegart aTegart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for giving me a walkthrough - LGTM!

@lfilmeyer lfilmeyer merged commit ba3fe5d into main Aug 7, 2024
4 checks passed
@lfilmeyer lfilmeyer deleted the new-admin-create-user-endpoint branch August 7, 2024 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants