✨ Guild invites
This commit is contained in:
		
							parent
							
								
									491565aef8
								
							
						
					
					
						commit
						cbe60955b4
					
				
							
								
								
									
										7570
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										7570
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -49,7 +49,7 @@ | ||||
| 		"i18next-http-middleware": "^3.1.3", | ||||
| 		"i18next-node-fs-backend": "^2.1.3", | ||||
| 		"jsonwebtoken": "^8.5.1", | ||||
| 		"lambert-server": "^1.2.4", | ||||
| 		"lambert-server": "^1.2.5", | ||||
| 		"missing-native-js-functions": "^1.2.6", | ||||
| 		"mongoose": "^5.12.3", | ||||
| 		"mongoose-autopopulate": "^0.12.3", | ||||
|  | ||||
							
								
								
									
										17
									
								
								src/routes/guilds/#guild_id/invites.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								src/routes/guilds/#guild_id/invites.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,17 @@ | ||||
| import { getPermission, InviteModel, toObject } from "@fosscord/server-util"; | ||||
| import { Request, Response, Router } from "express"; | ||||
| 
 | ||||
| const router = Router(); | ||||
| 
 | ||||
| router.get("/", async (req: Request, res: Response) => { | ||||
| 	const { guild_id } = req.params; | ||||
| 
 | ||||
| 	const permissions = await getPermission(req.user_id, guild_id); | ||||
| 	permissions.hasThrow("MANAGE_GUILD"); | ||||
| 
 | ||||
| 	const invites = await InviteModel.find({ guild_id }).exec(); | ||||
| 
 | ||||
| 	return res.json(toObject(invites)); | ||||
| }); | ||||
| 
 | ||||
| export default router; | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Flam3rboy
						Flam3rboy