More map editor work

This commit is contained in:
2025-01-05 04:52:16 +01:00
parent 33afef5466
commit 57b21f1499
6 changed files with 27 additions and 46 deletions

View File

@ -28,7 +28,10 @@ class MapRepository extends BaseRepository {
async getById(id: UUID) {
try {
const repository = this.getEntityManager().getRepository(Map)
return await repository.findOne({ id })
const result = await repository.findOne({ id })
if (result) result.setEntityManager(this.getEntityManager())
return result
} catch (error: any) {
this.logger.error(`Failed to get map by id: ${error.message}`)
return null