🚧 fix guild channel position
This commit is contained in:
		
							parent
							
								
									df0db20acd
								
							
						
					
					
						commit
						6b7de26f1c
					
				| @ -40,7 +40,7 @@ router.post("/", check(ChannelModifySchema), async (req: Request, res: Response) | |||||||
| // TODO: check if parent_id exists
 | // TODO: check if parent_id exists
 | ||||||
| router.patch( | router.patch( | ||||||
| 	"/", | 	"/", | ||||||
| 	check({ id: String, $position: Number, $lock_permissions: Boolean, $parent_id: String }), | 	check([{ id: String, $position: Number, $lock_permissions: Boolean, $parent_id: String }]), | ||||||
| 	async (req: Request, res: Response) => { | 	async (req: Request, res: Response) => { | ||||||
| 		// changes guild channel position
 | 		// changes guild channel position
 | ||||||
| 		const { guild_id } = req.params; | 		const { guild_id } = req.params; | ||||||
| @ -64,7 +64,7 @@ router.patch( | |||||||
| 
 | 
 | ||||||
| 		const channel = await ChannelModel.findOneAndUpdate({ id: req.body, guild_id }, opts).exec(); | 		const channel = await ChannelModel.findOneAndUpdate({ id: req.body, guild_id }, opts).exec(); | ||||||
| 
 | 
 | ||||||
| 		await emitEvent({ event: "CHANNEL_UPDATE", data: channel, channel_id: body.id } as ChannelUpdateEvent); | 		await emitEvent({ event: "CHANNEL_UPDATE", data: channel, channel_id: body.id, guild_id } as ChannelUpdateEvent); | ||||||
| 
 | 
 | ||||||
| 		res.json(toObject(channel)); | 		res.json(toObject(channel)); | ||||||
| 	} | 	} | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Flam3rboy
						Flam3rboy