Skip to content

Commit a2eb981

Browse files
refactor: move ApiResponse type to a dedicated file for better reusability
1 parent 600f232 commit a2eb981

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

app/page.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,7 @@ import { BrandLogo } from "@/components/brand-logo";
1010
import { AppHeader } from "@/components/app-header";
1111
import { AppFooter } from "@/components/app-footer";
1212
import { useTranslation } from "@/components/language-provider";
13-
14-
type ApiResponse = {
15-
success: boolean;
16-
users?: UserResult[];
17-
error?: string;
18-
};
13+
import { ApiResponse } from "@/types/api-response";
1914

2015
function HomePageInner() {
2116
const { t } = useTranslation();

types/api-response.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { UserResult } from "./user-result";
2+
3+
export type ApiResponse = {
4+
success: boolean;
5+
users?: UserResult[];
6+
error?: string;
7+
};

0 commit comments

Comments
 (0)