Skip to content

Commit

Permalink
globalでは管理しない
Browse files Browse the repository at this point in the history
  • Loading branch information
imamiya-masaki committed Dec 4, 2024
1 parent 7abc9a3 commit 75b36db
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
17 changes: 1 addition & 16 deletions frontend/app/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,4 @@
*/
declare const __API_BASE_URL__: string;

declare const __INITIAL_DATA__:
| {
owners: {
id: string;
name: string;
token: string;
}[];
simulatorChairs: {
id: string;
owner_id: string;
name: string;
model: string;
token: string;
}[];
}
| undefined;
declare const __INITIAL_DATA__: object;
19 changes: 18 additions & 1 deletion frontend/app/utils/get-initial-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,24 @@ type InitialOwner = {
token: string;
};

const initialData = __INITIAL_DATA__;
type initialDataType =
| {
owners: {
id: string;
name: string;
token: string;
}[];
simulatorChairs: {
id: string;
owner_id: string;
name: string;
model: string;
token: string;
}[];
}
| undefined;

const initialData = __INITIAL_DATA__ as initialDataType;

export const getOwners = (): InitialOwner[] => {
return (
Expand Down

0 comments on commit 75b36db

Please sign in to comment.