fix: subscription tier sync on admin override (#58) #61
@@ -78,13 +78,13 @@ export async function processGracePeriodExpirations(): Promise<GracePeriodResult
|
|||||||
|
|
||||||
await client.query(updateQuery, [subscription.id]);
|
await client.query(updateQuery, [subscription.id]);
|
||||||
|
|
||||||
// Sync tier to user_profiles table
|
// Sync tier to user_profiles table (user_id is auth0_sub)
|
||||||
const syncQuery = `
|
const syncQuery = `
|
||||||
UPDATE user_profiles
|
UPDATE user_profiles
|
||||||
SET
|
SET
|
||||||
subscription_tier = 'free',
|
subscription_tier = 'free',
|
||||||
updated_at = NOW()
|
updated_at = NOW()
|
||||||
WHERE user_id = $1
|
WHERE auth0_sub = $1
|
||||||
`;
|
`;
|
||||||
|
|
||||||
await client.query(syncQuery, [subscription.user_id]);
|
await client.query(syncQuery, [subscription.user_id]);
|
||||||
|
|||||||
Reference in New Issue
Block a user