From 3d5b504d356eced8b2bb5c920c0bde39b5e3033f Mon Sep 17 00:00:00 2001 From: zijiren233 Date: Fri, 26 Jul 2024 13:30:19 +0800 Subject: [PATCH] fix: db quota check --- frontend/providers/dbprovider/src/store/user.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/providers/dbprovider/src/store/user.ts b/frontend/providers/dbprovider/src/store/user.ts index ac77b3bbd39..4fa85fb4ad8 100644 --- a/frontend/providers/dbprovider/src/store/user.ts +++ b/frontend/providers/dbprovider/src/store/user.ts @@ -10,7 +10,7 @@ type State = { balance: number; userQuota: UserQuotaItemType[]; loadUserQuota: () => Promise; - checkQuotaAllow: (request: DBEditType, usedData?: DBEditType) => I18nCommonKey; + checkQuotaAllow: (request: DBEditType, usedData?: DBEditType) => I18nCommonKey | undefined; }; export const useUserStore = create()( @@ -26,7 +26,7 @@ export const useUserStore = create()( }); return null; }, - checkQuotaAllow: ({ cpu, memory, storage, replicas }, usedData): I18nCommonKey => { + checkQuotaAllow: ({ cpu, memory, storage, replicas }, usedData): I18nCommonKey | undefined => { const quote = get().userQuota; const request = { @@ -54,7 +54,7 @@ export const useUserStore = create()( } }); - return exceedQuota?.type ? overLimitTip[exceedQuota.type] : 'app.cpu_exceeds_quota'; + return exceedQuota?.type ? overLimitTip[exceedQuota.type] : undefined; } })) )