From 01bebeedbe33bda8e71ffdc27cb513bd4fc024ea Mon Sep 17 00:00:00 2001 From: Sergei Date: Fri, 9 Jan 2026 13:12:17 -0800 Subject: [PATCH] Fix invitations: remove expires_at (invitations are permanent) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove expires_at from SELECT queries - Remove expiresAt from API responses - DB change: dropped expires_at column, fixed FK to beneficiaries table 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- backend/src/routes/invitations.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/backend/src/routes/invitations.js b/backend/src/routes/invitations.js index 61a79d5..5caa423 100644 --- a/backend/src/routes/invitations.js +++ b/backend/src/routes/invitations.js @@ -354,8 +354,7 @@ router.post('/', async (req, res) => { id: invitation.id, code: invitation.token, role: role, - email: email || null, - expiresAt: invitation.expires_at + email: email || null } }); @@ -389,7 +388,7 @@ router.get('/beneficiary/:beneficiaryId', async (req, res) => { // Get invitations for this beneficiary const { data: invitations, error } = await supabase .from('invitations') - .select('id, token, role, email, label, expires_at, accepted_at, accepted_by, created_at') + .select('id, token, role, email, label, accepted_at, accepted_by, created_at') .eq('beneficiary_id', beneficiaryId) .order('created_at', { ascending: false }); @@ -417,7 +416,6 @@ router.get('/beneficiary/:beneficiaryId', async (req, res) => { role: inv.role, email: inv.email, label: inv.label, - expiresAt: inv.expires_at, acceptedAt: inv.accepted_at, createdAt: inv.created_at, acceptedBy: acceptedUser ? { @@ -561,7 +559,7 @@ router.get('/', async (req, res) => { // Get invitations const { data: invitations, error } = await supabase .from('invitations') - .select('id, token, role, email, label, beneficiary_id, expires_at, accepted_at, created_at') + .select('id, token, role, email, label, beneficiary_id, accepted_at, created_at') .eq('invited_by', userId) .order('created_at', { ascending: false }); @@ -585,7 +583,6 @@ router.get('/', async (req, res) => { role: inv.role, email: inv.email, label: inv.label, - expiresAt: inv.expires_at, acceptedAt: inv.accepted_at, createdAt: inv.created_at, beneficiary: beneficiary ? {