diff --git a/src/app/api/projects/index.ts b/src/app/api/projects/index.ts index 82440a9..8374721 100644 --- a/src/app/api/projects/index.ts +++ b/src/app/api/projects/index.ts @@ -2,20 +2,6 @@ import { serverFetchJson } from "@/app/utils/fetchUtil"; import { BASE_API_URL } from "@/config/api"; import { cache } from "react"; import "server-only"; -import { Staff } from "../staff"; - -interface Project { - id: number; - code: string; - name: string; - projectCategory: { - name: string; - }; - teamLead: Staff; - customer: { - name: string; - }; -} export interface ProjectResult { id: number; @@ -37,24 +23,9 @@ export const preloadProjects = () => { }; export const fetchProjects = cache(async () => { - const projects = await serverFetchJson( - `${BASE_API_URL}/projects`, - { - next: { tags: ["projects"] }, - }, - ); - - // TODO: Replace this with a project - return projects.map( - ({ id, code, name, projectCategory, teamLead, customer }) => ({ - id, - code, - name, - category: projectCategory.name, - team: teamLead.team.code, - client: customer.name, - }), - ); + return serverFetchJson(`${BASE_API_URL}/projects`, { + next: { tags: ["projects"] }, + }); }); export const fetchProjectCategories = cache(async () => {