diff --git a/src/utilities/http.ts b/src/utilities/http.ts index 6cf19d8..b7dcd85 100644 --- a/src/utilities/http.ts +++ b/src/utilities/http.ts @@ -63,34 +63,34 @@ async function addHttpRoutes(app: Application) { * @param req * @param res */ - app.get('/assets/tiles/:zoneId', async (req: Request, res: Response) => { - const zoneId = req.params.zoneId - - // Check if zoneId is valid number - if (!zoneId || parseInt(zoneId) === 0) { - return res.status(400).json({ message: 'Invalid zone ID' }) - } - - // Get zone by id - const zone = await zoneRepository.getById(parseInt(zoneId)) - if (!zone) { - return res.status(404).json({ message: 'Zone not found' }) - } - - let tiles = zone.tiles; - - // Convert to array - tiles = JSON.parse(JSON.stringify(tiles)) as string[] - - // Flatten the array - tiles = [...new Set(tiles.flat())] - - // Remove duplicates - tiles = tiles.filter((value, index, self) => self.indexOf(value) === index); - - // Return the array - res.json(tiles) - }) + // app.get('/assets/tiles/:zoneId', async (req: Request, res: Response) => { + // const zoneId = req.params.zoneId + // + // // Check if zoneId is valid number + // if (!zoneId || parseInt(zoneId) === 0) { + // return res.status(400).json({ message: 'Invalid zone ID' }) + // } + // + // // Get zone by id + // const zone = await zoneRepository.getById(parseInt(zoneId)) + // if (!zone) { + // return res.status(404).json({ message: 'Zone not found' }) + // } + // + // let tiles = zone.tiles; + // + // // Convert to array + // tiles = JSON.parse(JSON.stringify(tiles)) as string[] + // + // // Flatten the array + // tiles = [...new Set(tiles.flat())] + // + // // Remove duplicates + // tiles = tiles.filter((value, index, self) => self.indexOf(value) === index); + // + // // Return the array + // res.json(tiles) + // }) /** * Get a specific asset