Commit e1717c7c authored by Дмитрий Малюгин's avatar Дмитрий Малюгин 🕓
Browse files

Merge branch 'refs/heads/feature/pagesRoute'

parents 3f88811c f11796b3
Loading
Loading
Loading
Loading

.yarn/install-state.gz

0 → 100644
+234 KiB

File added.

No diff preview for this file type.

.yarnrc.yml

0 → 100644
+1 −0
Original line number Diff line number Diff line
nodeLinker: node-modules
+4 −0
Original line number Diff line number Diff line
@@ -27,5 +27,9 @@
    "ts-node": "^10.9.2",
    "tsx": "^4.19.0",
    "typescript": "^5.5.4"
  },
  "volta": {
    "node": "20.17.0",
    "yarn": "4.5.0"
  }
}
+1 −0
Original line number Diff line number Diff line
@@ -117,6 +117,7 @@ class EntitiesService {
      fs.unlink(body.image_path, (err) => {
        if (err) throw err;
      });
    await PagesService.deletePageEntity(body.page_uuid, body.entity_uuid);
    return {
      entity_uuid: body.entity_uuid
    };
+16 −0
Original line number Diff line number Diff line
@@ -92,6 +92,22 @@ class PagesService {
      }
    });
  }
  async deletePageEntity(page_uuid: string, entity_uuid: string) {
    const newState = await prisma.page.findFirst({
      where: {
        page_uuid: page_uuid
      }
    });
    newState.page_entities = newState.page_entities.filter(
      (entity) => entity.entity_uuid !== entity_uuid
    );
    await prisma.page.update({
      data: { ...newState },
      where: {
        page_uuid: page_uuid
      }
    });
  }
  async deletePageBackground(page_uuid: string) {
    const imagePath = path.join(path.resolve(), `/public/images/backgrounds/homeBackground.jpg`);
    fs.unlink(imagePath, (err) => {
Loading