hack4impact-utk / compassion-ministries

https://compassion-ministries.vercel.app
2 stars 2 forks source link

266 create server funcapi endpoint for updating allowed users #346

Closed ethanhmaness closed 6 months ago

ethanhmaness commented 7 months ago

Description

266

Questions

It seems sketchy to be overwriting the Settings schema directly from the server func, but there's no existing server func for adding emails to the Settings schema. It also seems sketchy to just pass the request directly into the server func, though that's what the issue said to do. Should we validate that the user ids correspond to actual users first?

Type of change

Checklist:

To test

Log in as an admin and send a PUT request to /api/users that looks something like this

{
    "userEmails": ["ethanhmaness@gmail.com", "emaness@vols.utk.edu"],
    "adminIds": ["6625acc38b667741185a92ae", "662921e0e3a3ebfe912a9200"]
}

Send it a second time to check that it doesn't add duplicate emails.

NOTE: You can't use Postman for this, gotta do it directly thru the browser so your account can be authenticated.

vercel[bot] commented 7 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
compassion-ministries ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 29, 2024 8:29pm