Skip to content

Commit

Permalink
Fix type format
Browse files Browse the repository at this point in the history
  • Loading branch information
ProchaLu committed Oct 24, 2024
1 parent dd037c0 commit ce6c4f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
16 changes: 3 additions & 13 deletions app/api/[guestId]+api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ import {
guestsSchema,
} from '../../migrations/00000-createTableGuests';

type GuestResponseBodyGet =
| {
guest: Guest;
}
| { error: string };
type GuestResponseBodyGet = { guest: Guest } | { error: string };

export async function GET(
request: Request,
Expand All @@ -31,9 +27,7 @@ export async function GET(
}

type GuestResponseBodyPut =
| {
guest: Guest;
}
| { guest: Guest }
| { error: string; errorIssues?: { message: string }[] };

export async function PUT(
Expand Down Expand Up @@ -71,11 +65,7 @@ export async function PUT(
return ExpoApiResponse.json({ guest: updatedGuest });
}

type GuestResponseBodyDelete =
| {
guest: Guest;
}
| { error: string };
type GuestResponseBodyDelete = { guest: Guest } | { error: string };

export async function DELETE(
request: Request,
Expand Down
8 changes: 2 additions & 6 deletions app/api/guests+api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import {
} from '../../migrations/00000-createTableGuests';

type GuestResponseBodyPost =
| {
guest: Guest;
}
| { guest: Guest }
| { error: string; errorIssues?: { message: string }[] };

export async function POST(
Expand Down Expand Up @@ -50,9 +48,7 @@ export async function POST(
return ExpoApiResponse.json({ guest: guest });
}

type GuestResponseBodyGet = {
guests: Guest[];
};
type GuestResponseBodyGet = { guests: Guest[] };

export async function GET(
request: Request,
Expand Down

0 comments on commit ce6c4f6

Please sign in to comment.