From bee0866d41d3977a734e672391e3e18d0236ed96 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Tue, 15 Sep 2026 09:50:57 +0800 Subject: [PATCH] fix(1895): api/points/index.ts - fix TS errors (import types, hasEnoughPoints API, field names, DiscountKey) --- apps/web/src/api/points/index.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/web/src/api/points/index.ts b/apps/web/src/api/points/index.ts index 21d92b3ff..08e5420a2 100644 --- a/apps/web/src/api/points/index.ts +++ b/apps/web/src/api/points/index.ts @@ -5,8 +5,10 @@ import apiClient from "../client" import type { PointsBalance, + PointsTransaction, PointsTransactionsParams, PointsTransactionsResponse, + PointsPackage, PointsPackagesResponse, PointsRechargeRequest, PointsOrder, @@ -284,8 +286,13 @@ export async function createPointsOrder(req: PointsRechargeRequest): Promise p.id === req.package_id) const mt = MOCK_PACKAGES.user_member_type - const discountKey = `discounted_price_for_${mt}` as keyof PointsPackage - const price = (pkg?.[discountKey] as number | undefined) ?? pkg?.price ?? 0 + type DiscountKey = + | "discounted_price_for_free" + | "discounted_price_for_monthly" + | "discounted_price_for_quarterly" + | "discounted_price_for_yearly" + const discountKey = `discounted_price_for_${mt}` as DiscountKey + const price = pkg?.[discountKey] ?? pkg?.price ?? 0 return new Promise((r) => setTimeout( () =>