fix #129
This commit is contained in:
		
							parent
							
								
									8893fd16d9
								
							
						
					
					
						commit
						8f862f0e5d
					
				
							
								
								
									
										17
									
								
								api/src/routes/guilds/#guild_id/webhooks.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								api/src/routes/guilds/#guild_id/webhooks.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,17 @@ | ||||
| import { Router, Response, Request } from "express"; | ||||
| import { route } from "@fosscord/api"; | ||||
| import { Webhook } from "@fosscord/util"; | ||||
| 
 | ||||
| const router: Router = Router(); | ||||
| 
 | ||||
| router.get("/", route({ permission: "MANAGE_WEBHOOKS" }), async (req: Request, res: Response) => { | ||||
| 	const webhooks = await Webhook.find({ | ||||
| 		where: { guild_id: req.params.guild_id }, | ||||
| 		select: ["application", "avatar", "channel_id", "guild_id", "id", "token", "type", "user", "source_guild", "name"], | ||||
| 		relations: ["user", "application", "source_guild"] | ||||
| 	}); | ||||
| 
 | ||||
| 	return res.json(webhooks); | ||||
| }); | ||||
| 
 | ||||
| export default router; | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Flam3rboy
						Flam3rboy