game object module
This commit is contained in:
@@ -117,7 +117,9 @@ class GameObjectsManager{
|
||||
}else{
|
||||
object.asset.type = 'single';
|
||||
await fs.promises.copyFile(src, def + ext);
|
||||
await this.addThumb(object, src);
|
||||
if (['.jpg', '.png', '.webp'].includes(ext)){
|
||||
await this.addThumb(object, src);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,11 @@ class GameObjectsController{
|
||||
res.json(object);
|
||||
})
|
||||
|
||||
router.delete('/:id', async (req, res)=>{
|
||||
await gameObject.remove(req.params.id);
|
||||
res.json({status: 'OK'});
|
||||
})
|
||||
|
||||
app.webServer.xapp.use(this.route, router);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user