Added missing entities( zoneEffect, zoneEventTile, zoneEventTileTeleport, zoneObject)
This commit is contained in:
@ -1,15 +1,22 @@
|
||||
import prisma from '#utilities/prisma' // Import the global Prisma instance
|
||||
import { Object } from '@prisma/client'
|
||||
import { BaseRepository } from '#repositories/baseRepository'
|
||||
|
||||
class ObjectRepository {
|
||||
async getById(id: string): Promise<Object | null> {
|
||||
return prisma.object.findUnique({
|
||||
where: { id }
|
||||
})
|
||||
class ObjectRepository extends BaseRepository {
|
||||
async getById(id: string): Promise<any> {
|
||||
try {
|
||||
const repository = this.em.getRepository(Object)
|
||||
return await repository.findOne({ id })
|
||||
} catch (error: any) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
async getAll(): Promise<Object[]> {
|
||||
return prisma.object.findMany()
|
||||
async getAll(): Promise<any> {
|
||||
try {
|
||||
const repository = this.em.getRepository(Object)
|
||||
return await repository.findAll()
|
||||
} catch (error: any) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user