refactor 6 month retention. use auth instead of cache:website

This commit is contained in:
Francis Cao 2025-12-18 10:35:52 -08:00
parent 37b6194c5f
commit 741c6039e6
29 changed files with 43 additions and 48 deletions

View file

@ -1,6 +1,6 @@
import { z } from 'zod';
import { uuid } from '@/lib/crypto';
import redis from '@/lib/redis';
import { fetchAccount } from '@/lib/load';
import { getQueryFilters, parseRequest } from '@/lib/request';
import { json, unauthorized } from '@/lib/response';
import { pagingParams, searchParams } from '@/lib/schema';
@ -52,7 +52,7 @@ export async function POST(request: Request) {
const { id, name, domain, shareId, teamId } = body;
if (process.env.CLOUD_MODE && !teamId) {
const account = await redis.client.get(`account:${auth.user.id}`);
const account = await fetchAccount(auth.user.id);
if (!account?.hasSubscription) {
const count = await getWebsiteCount(auth.user.id);