-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat(cabins): admin queries, add feedback and questions to booking (#…
…512) * ✨ feat(cabins): find many bookings, booking questions and feedback * chore: add debug config
- Loading branch information
Showing
24 changed files
with
723 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"command": "pnpm dev", | ||
"name": "Run pnpm dev", | ||
"request": "launch", | ||
"type": "node-terminal", | ||
"skipFiles": ["<node_internals>/**"] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"[typescript][javascript][json][typescriptreact]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[prisma]": { | ||
"editor.defaultFormatter": "Prisma.prisma" | ||
} | ||
"editor.formatOnSave": true, | ||
"[typescript][javascript][json][typescriptreact]": { | ||
"editor.defaultFormatter": "biomejs.biome", | ||
"editor.codeActionsOnSave": { | ||
"quickfix.biome": "explicit", | ||
"source.organizeImports.biome": "explicit" | ||
} | ||
}, | ||
"[prisma]": { | ||
"editor.defaultFormatter": "Prisma.prisma" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import type { BookingsResponseResolvers } from "./../../types.generated.js"; | ||
export const BookingsResponse: BookingsResponseResolvers = { | ||
/* Implement BookingsResponse resolver logic here */ | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 5 additions & 7 deletions
12
src/graphql/cabins/resolvers/Mutation/updateBookingStatus.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import type { QueryResolvers } from "./../../../types.generated.js"; | ||
export const bookings: NonNullable<QueryResolvers["bookings"]> = async ( | ||
_parent, | ||
{ data }, | ||
ctx, | ||
) => { | ||
const result = await ctx.cabins.findManyBookings(ctx, { | ||
bookingStatus: data?.status, | ||
}); | ||
|
||
if (!result.ok) { | ||
switch (result.error.name) { | ||
case "PermissionDeniedError": | ||
case "UnauthorizedError": | ||
return { | ||
bookings: [], | ||
total: 0, | ||
}; | ||
case "InternalServerError": | ||
throw result.error; | ||
} | ||
} | ||
return { | ||
bookings: result.data.bookings, | ||
total: result.data.total, | ||
}; | ||
}; |
Oops, something went wrong.