Skip to content

Move ApiResponse type to global types directory #137

@O2sa

Description

@O2sa

📝 Description

Currently, the ApiResponse type is hardcoded inside app/page.tsx. This makes it difficult to reuse in other components or API routes. We need to move this definition to a centralized file in the types folder.

📍 Source Location

app/page.tsx

🎯 Target Location

types/api-response.ts

🛠 Tasks

  • Create the file in the types/ directory.
  • Move the following code block to that file and add the export keyword:
    export type ApiResponse = {
      success: boolean;
      users?: UserResult[];
      error?: string;
    };
  • Import ApiResponse back into app/page.tsx.
  • Verify that the project still builds without type errors.

Tip

🚀 Want to contribute?
Comment assign me to be automatically assigned to this issue via our GitHub Actions bot. Happy coding! ✨

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions