bruhmoment
This commit is contained in:
parent
9949b51f3f
commit
5b2bea0dbe
@ -39,6 +39,35 @@ async function addHttpRoutes(app: Application) {
|
||||
res.json(assets)
|
||||
})
|
||||
|
||||
/**
|
||||
* Get all assets for all zones
|
||||
* @param req
|
||||
* @param res
|
||||
*/
|
||||
app.get('/assets/zone', async (req: Request, res: Response) => {
|
||||
const tiles = await tileRepository.getAll()
|
||||
const objects = await objectRepository.getAll()
|
||||
|
||||
const assets: TAsset[] = []
|
||||
tiles.forEach((tile) => {
|
||||
assets.push({
|
||||
key: tile.id,
|
||||
url: '/assets/tiles/' + tile.id + '.png',
|
||||
group: 'tiles'
|
||||
})
|
||||
})
|
||||
|
||||
objects.forEach((object) => {
|
||||
assets.push({
|
||||
key: object.id,
|
||||
url: '/assets/objects/' + object.id + '.png',
|
||||
group: 'objects'
|
||||
})
|
||||
})
|
||||
|
||||
res.json(assets)
|
||||
})
|
||||
|
||||
/**
|
||||
* Get assets for a specific zone
|
||||
* @param req
|
||||
|
Loading…
x
Reference in New Issue
Block a user