1
0
forked from noxious/server
This commit is contained in:
2025-01-02 18:14:12 +01:00
parent 11041fec83
commit fecdf222d7
2 changed files with 3 additions and 3 deletions

View File

@ -0,0 +1,24 @@
import { BaseRepository } from '#application/base/baseRepository'
import { UUID } from '#application/types'
class MapObjectRepository extends BaseRepository {
async getById(id: UUID): Promise<any> {
try {
const repository = this.em.getRepository(Object)
return await repository.findOne({ id })
} catch (error: any) {
return null
}
}
async getAll(): Promise<any> {
try {
const repository = this.em.getRepository(Object)
return await repository.findAll()
} catch (error: any) {
return null
}
}
}
export default new MapObjectRepository()