코드 검토 및 문서 반영
This commit is contained in:
@@ -5,23 +5,15 @@ import { createUpgradeRequest } from "@/lib/upgrade-requests";
|
||||
import { ApiError } from "@/lib/errors";
|
||||
import { withApiHandler } from "@/lib/api-handler";
|
||||
import { logger } from "@/lib/logger";
|
||||
import { ACCOUNT_TYPES } from "@/lib/constants";
|
||||
import { PAID_ACCOUNT_TYPE_VALUES } from "@/lib/constants";
|
||||
|
||||
const CTX = "maestros/[id]/upgrade-requests";
|
||||
|
||||
const paidAccountTypeValues = [
|
||||
ACCOUNT_TYPES.BASIC_20,
|
||||
ACCOUNT_TYPES.STANDARD_50,
|
||||
ACCOUNT_TYPES.PRO_100,
|
||||
ACCOUNT_TYPES.SCHOOL_500,
|
||||
ACCOUNT_TYPES.SCHOOL_1000,
|
||||
] as const;
|
||||
|
||||
const postBodySchema = z.object({
|
||||
requestedAccountType: z.coerce
|
||||
.number()
|
||||
.int()
|
||||
.refine((v) => (paidAccountTypeValues as readonly number[]).includes(v)),
|
||||
.refine((v) => (PAID_ACCOUNT_TYPE_VALUES as readonly number[]).includes(v)),
|
||||
});
|
||||
|
||||
export const POST = withApiHandler<{ id: string }>(
|
||||
|
||||
Reference in New Issue
Block a user