Skip to content

Commit

Permalink
chore(dcellar-web-ui): resolve build error
Browse files Browse the repository at this point in the history
  • Loading branch information
devinxl committed May 23, 2024
1 parent c4899e1 commit b03e36a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
15 changes: 3 additions & 12 deletions apps/dcellar-web-ui/src/facade/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down Expand Up @@ -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);
};

Expand Down Expand Up @@ -457,7 +457,7 @@ export const getBucketActivities = async (id: string): Promise<Activity[]> => {
if (!result) return [];

return result.data.result || [];
}
};

export const migrateBucket = async (
params: MigrateBucketApprovalRequest,
Expand All @@ -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<Activity[]> => {
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 || [];
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
TBucket,
setupBucketActivity,
BucketOperationsType,
setupBucketActivity,
} from '@/store/slices/bucket';
import { selectBucketSp } from '@/store/slices/sp';
import { convertObjectKey } from '@/utils/common';
Expand Down Expand Up @@ -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) => (
<Text as={'div'} fontSize={'14px'} fontWeight={500} color="readable.tertiary">
Expand Down
2 changes: 0 additions & 2 deletions apps/dcellar-web-ui/src/store/slices/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit b03e36a

Please sign in to comment.