From a8976b2eeef9d2c1b0c6e5ff555a07951032be67 Mon Sep 17 00:00:00 2001 From: eric Date: Thu, 26 Mar 2026 11:41:00 -0500 Subject: [PATCH] ' --- app/api/vip/check-by-user/route.ts | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/app/api/vip/check-by-user/route.ts b/app/api/vip/check-by-user/route.ts index cd4b359..80a1fe5 100644 --- a/app/api/vip/check-by-user/route.ts +++ b/app/api/vip/check-by-user/route.ts @@ -16,27 +16,22 @@ type PayjsVipResult = { }; const inflightUserChecks = new Map>(); +type UserCheckPayload = { + ok: boolean; + vip: boolean; + alreadyLinked: boolean; + email?: string; + linkedUserId?: string; +}; const inflightUserRequests = new Map< string, - Promise<{ - ok: true; - vip: boolean; - alreadyLinked: boolean; - email?: string; - linkedUserId?: string; - }> + Promise >(); const userCheckResultCache = new Map< string, { expiresAt: number; - payload: { - ok: true; - vip: boolean; - alreadyLinked: boolean; - email?: string; - linkedUserId?: string; - }; + payload: UserCheckPayload; } >(); const USER_CHECK_CACHE_TTL_MS = Number(process.env.CHECK_BY_USER_CACHE_TTL_MS) || 10_000;