Skip to content

Commit

Permalink
feat: introducton to RP 0 calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
sugrado committed Feb 13, 2024
1 parent df521bf commit 9a84324
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion v1/src/services/site.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 9a84324

Please sign in to comment.