Feat/settings page#15
Closed
FaresM7 wants to merge 5 commits into
Closed
Conversation
Stores runtime-configurable values (report recipients, PIN override) so they can be changed through the admin UI without a redeployment. - New admin_settings table with RLS (service role only) - Seeds report_recipients and admin_pin rows as empty strings - Adds anon SELECT policy on transactions_archive for stats queries - Adds admin_settings types to database.types.ts
…y-pin - settings.ts: GET/POST for admin_settings key-value pairs (PIN auth) - archive.ts: manually archive+prune current month without sending email - change-pin.ts: verify current PIN then write new PIN to settings table - verify-pin.ts: dual-source PIN lookup (DB admin_pin → ADMIN_PIN env var) so PIN changes take effect immediately without redeployment
- Add fetchRecipients(): reads report_recipients from admin_settings, falls back to ADMIN_EMAIL env var for backward compatibility - sendEmail() now accepts recipients[] instead of reading ADMIN_EMAIL internally, enabling multi-recipient support - runMonthlyReport() fetches recipients in parallel with PDF/Excel gen
- Berichtsempfänger: add/remove email recipients stored in admin_settings - PIN ändern: change admin PIN with current-PIN verification; updates sessionStorage so the active session keeps working immediately - Datenverwaltung: live + archive stats cards, manual archive trigger (archive + prune without sending email, shows archived row count) - Über die App: version, Datenschutz link, hackathon attribution - Replace settings placeholder in AdminDashboard with <SettingsPage />
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…-active PostgreSQL applies a SELECT policy's USING clause as implicit WITH CHECK on any UPDATE that would make the row invisible. The old policy anon_read_active_members (USING active = true) caused setting active = false to fail with 42501 — the new row violated the visibility check of the SELECT policy even though the explicit UPDATE WITH CHECK was (true). Fix: replace with anon_read_members (USING true). The member-facing flow already filters active = true in application code so behaviour is unchanged for members. Admin can now deactivate and reactivate without error.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
What does this PR do?
Please include a concise summary of the changes and/or features you are introducing with this PR.
Related Issues and PRs
What types of changes does your code introduce?
Checklist: