From 9a843242cae02f63d2fd63d8882903decb1194b8 Mon Sep 17 00:00:00 2001 From: Gorkem Ridvan <76165528+sugrado@users.noreply.github.com> Date: Tue, 13 Feb 2024 21:59:56 +0300 Subject: [PATCH] feat: introducton to RP 0 calculation --- v1/src/services/site.service.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/v1/src/services/site.service.js b/v1/src/services/site.service.js index 05e225d..0425db9 100644 --- a/v1/src/services/site.service.js +++ b/v1/src/services/site.service.js @@ -45,12 +45,20 @@ const insertWithRelations = async (body) => { resistivities, } = body; - const siteToInsert = await insert(site); + const { height, ...siteWithoutHeight } = site; + + const siteToInsert = await insert({ ...siteWithoutHeight }); const siteBoundToInsert = await insertSiteBound({ site: siteToInsert._id, ...siteBound, }); + await insertRp({ + siteBound: siteBoundToInsert._id, + positionZ: height, + name: 'RP 0', + }); + for (const rp of rps) { const { discs, ...rest } = rp; const rpToInsert = await insertRp({