forked from noxious/server
a
This commit is contained in:
parent
37764847a9
commit
cc6f8d212e
@ -58,7 +58,6 @@ class ZoneRepository {
|
|||||||
|
|
||||||
async update(id: number, name: string, width: number, height: number, tiles: string[][], objects: ZoneObject[]): Promise<Zone> {
|
async update(id: number, name: string, width: number, height: number, tiles: string[][], objects: ZoneObject[]): Promise<Zone> {
|
||||||
try {
|
try {
|
||||||
console.log(tiles);
|
|
||||||
return await prisma.zone.update({
|
return await prisma.zone.update({
|
||||||
where: {
|
where: {
|
||||||
id: id
|
id: id
|
||||||
@ -72,6 +71,7 @@ class ZoneRepository {
|
|||||||
deleteMany: {
|
deleteMany: {
|
||||||
zoneId: id // Ensure only objects related to the zone are deleted
|
zoneId: id // Ensure only objects related to the zone are deleted
|
||||||
},
|
},
|
||||||
|
// Save new zone objects
|
||||||
create: objects.map(obj => ({
|
create: objects.map(obj => ({
|
||||||
objectId: obj.objectId,
|
objectId: obj.objectId,
|
||||||
position_x: obj.position_x,
|
position_x: obj.position_x,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user