Browse Source

fix: type errors

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang 2 months ago
parent
commit
bc885b2889
2 changed files with 4 additions and 4 deletions
  1. 2 2
      client/src/pages/home/DatabaseCard.tsx
  2. 2 2
      client/src/pages/home/Home.tsx

+ 2 - 2
client/src/pages/home/DatabaseCard.tsx

@@ -10,7 +10,7 @@ import { rootContext, authContext } from '@/context';
 import CreateDatabaseDialog from '../dialogs/CreateDatabaseDialog';
 import { CREATE_DB } from './Home';
 import { makeStyles } from '@mui/styles';
-import type { DatabaseObject } from '@server/types';
+import type { DatabaseObject, ResStatus } from '@server/types';
 
 const useStyles = makeStyles((theme: Theme) => ({
   wrapper: {
@@ -89,7 +89,7 @@ export interface DatabaseCardProps {
   wrapperClass?: string;
   database: DatabaseObject;
   setDatabase: (database: string) => void;
-  dropDatabase: (params: { db_name: string }) => Promise<void>;
+  dropDatabase: (params: { db_name: string }) => Promise<ResStatus>;
   isActive?: boolean;
 }
 

+ 2 - 2
client/src/pages/home/Home.tsx

@@ -83,8 +83,8 @@ const Home = () => {
       unit = withinOneHour
         ? homeTrans('minutes')
         : withinOneDay
-        ? homeTrans('hours')
-        : homeTrans('day');
+          ? homeTrans('hours')
+          : homeTrans('day');
     }
 
     return `${duration.toFixed(2)} ${unit}`;