From b03e36a5b74ff55ebaa80beda3c0a75ad6af2c5a Mon Sep 17 00:00:00 2001 From: devinxl Date: Wed, 22 May 2024 10:22:26 +0800 Subject: [PATCH] chore(dcellar-web-ui): resolve build error --- apps/dcellar-web-ui/src/facade/bucket.ts | 15 +++------------ .../bucket/components/DetailBucketOperation.tsx | 2 -- apps/dcellar-web-ui/src/store/slices/bucket.ts | 2 -- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/apps/dcellar-web-ui/src/facade/bucket.ts b/apps/dcellar-web-ui/src/facade/bucket.ts index 77c9c955..d2133496 100644 --- a/apps/dcellar-web-ui/src/facade/bucket.ts +++ b/apps/dcellar-web-ui/src/facade/bucket.ts @@ -66,7 +66,7 @@ export const headBucket = async (bucketName: string) => { const client = await getClient(); const { bucketInfo } = await client.bucket .headBucket(bucketName) - .catch(() => ({} as QueryHeadBucketResponse)); + .catch(() => ({}) as QueryHeadBucketResponse); return bucketInfo || null; }; @@ -262,7 +262,7 @@ export const getBucketQuotaUpdateTime = async (bucketName: string) => { const defaultValue = new Long(getTimestampInSeconds()); const res = await storageClient .QueryQuotaUpdateTime({ bucketName }) - .catch((e) => ({ updateAt: defaultValue } as QueryQuoteUpdateTimeResponse)); + .catch((e) => ({ updateAt: defaultValue }) as QueryQuoteUpdateTimeResponse); return Number(res?.updateAt || defaultValue); }; @@ -457,7 +457,7 @@ export const getBucketActivities = async (id: string): Promise => { if (!result) return []; return result.data.result || []; -} +}; export const migrateBucket = async ( params: MigrateBucketApprovalRequest, @@ -482,13 +482,4 @@ export const cancelMigrateBucket = async ( if (!tx) return [null, error1]; return broadcastTx({ tx: tx, address: params.operator, connector }); -} - -export const getBucketActivities = async (id: string): Promise => { - const url = `/api/tx/list/by_bucket/${id}`; - - const [result] = await axios.get<{ result: Activity[] }>(url).then(resolve, commonFault); - if (!result) return []; - - return result.data.result || []; }; diff --git a/apps/dcellar-web-ui/src/modules/bucket/components/DetailBucketOperation.tsx b/apps/dcellar-web-ui/src/modules/bucket/components/DetailBucketOperation.tsx index 2d003c24..63cf8687 100644 --- a/apps/dcellar-web-ui/src/modules/bucket/components/DetailBucketOperation.tsx +++ b/apps/dcellar-web-ui/src/modules/bucket/components/DetailBucketOperation.tsx @@ -13,7 +13,6 @@ import { TBucket, setupBucketActivity, BucketOperationsType, - setupBucketActivity, } from '@/store/slices/bucket'; import { selectBucketSp } from '@/store/slices/sp'; import { convertObjectKey } from '@/utils/common'; @@ -45,7 +44,6 @@ import { useMount, useUnmount } from 'ahooks'; import { DEFAULT_TAG } from '@/components/common/ManageTags'; import { Activities } from '@/components/Activities'; import { BucketStatus } from '@bnb-chain/greenfield-js-sdk'; -import { Activities } from '@/components/Activities'; export const Label = ({ children }: PropsWithChildren) => ( diff --git a/apps/dcellar-web-ui/src/store/slices/bucket.ts b/apps/dcellar-web-ui/src/store/slices/bucket.ts index 8993fa9c..6a7f66ff 100644 --- a/apps/dcellar-web-ui/src/store/slices/bucket.ts +++ b/apps/dcellar-web-ui/src/store/slices/bucket.ts @@ -19,8 +19,6 @@ import { convertObjectKey } from '@/utils/common'; import { Activity } from './object'; import { numberToHex } from 'viem'; import { BucketStatus as BucketStatusEnum } from '@bnb-chain/greenfield-js-sdk'; -import { Activity } from './object'; -import { numberToHex } from 'viem'; export type BucketOperationsType = | 'detail'