feat(admin): Add adoption inquiries management and UI updates - #3
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b7f6cf9e03
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const updateStatus = async (id, status) => { | ||
| const { error } = await supabase | ||
| .from('adoptions') | ||
| .update({ status }) |
There was a problem hiding this comment.
When an admin approves or rejects a pending inquiry, this call attempts to update adoptions, but the migration enables RLS on that table and only defines SELECT/INSERT policies for it; unlike reports, volunteers, and cats, there is no FOR UPDATE policy. In any Supabase database created from this schema, the new Approve/Reject buttons will hit an RLS error and always show the failure toast instead of changing the inquiry status.
Useful? React with 👍 / 👎.
| note: volunteerData.note || null, | ||
| available_dates: volunteerData.availableDates || [], | ||
| status: 'active', | ||
| status: 'pending', |
There was a problem hiding this comment.
Add a real migration for pending volunteers
In environments that already applied supabase/migrations/001_initial_schema.sql before this change, inserting new volunteer applications with status: 'pending' will still violate the existing volunteers status CHECK constraint, because this commit only edits the already-applied initial migration instead of adding an ALTER migration to allow pending. Supabase/Postgres will not replay migration 001, so public volunteer sign-ups start returning the generic "Could not submit" error until the live constraint is migrated.
Useful? React with 👍 / 👎.
No description provided.