File tree 2 files changed +18
-1
lines changed
src/routes/api/guilds/[guild]
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ module.exports.get = fastify => ({
5
5
handler : async ( req , res ) => {
6
6
const { client } = req . routeOptions . config ;
7
7
const guild = client . guilds . cache . get ( req . params . guild ) ;
8
- if ( ! guild ) return res . status ( 404 ) . send ( new Error ( 'Not Found' ) ) ;
9
8
res . send ( {
10
9
id : guild . id ,
11
10
logo : iconURL ( guild ) ,
Original file line number Diff line number Diff line change
1
+ module . exports . get = fastify => ( {
2
+ handler : async ( req , res ) => {
3
+ const { client } = req . routeOptions . config ;
4
+ /** @type {import("@prisma/client").PrismaClient } */
5
+ const prisma = client . prisma ;
6
+ const guild = client . guilds . cache . get ( req . params . guild ) ;
7
+ res . send (
8
+ await prisma . ticket . findMany ( {
9
+ where : {
10
+ createdById : req . user . id ,
11
+ guildId : guild . id ,
12
+ } ,
13
+ } ) ,
14
+ ) ;
15
+ } ,
16
+ onRequest : [ fastify . authenticate , fastify . isMember ] ,
17
+ } ) ;
18
+
You can’t perform that action at this time.
0 commit comments