Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions middlewares/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ async function insertProject(name, req) {
return idProject;
}

async function insertJob(name, command, idProject, tags, req) {
async function insertJob(name, command, idProject, tags, geometry, req) {
debug(`Insertion du job ${name}`);
let idJob;
try {
const results = await req.client.query('INSERT INTO jobs (name, command, id_project, tags) VALUES ($1, $2, $3, $4) RETURNING id', [name, command, idProject, tags]);
const results = await req.client.query('INSERT INTO jobs (name, command, id_project, tags, geometry) VALUES ($1, $2, $3, $4, ST_Transform($5, 4326)) RETURNING id', [name, command, idProject, tags, geometry]);
idJob = results.rows[0].id;
req.idJobs.push(idJob);
} catch (error) {
Expand Down Expand Up @@ -110,7 +110,7 @@ async function insertProjectFromJson(req, res, next) {
for (const job of project.jobs) {
/* eslint-disable no-await-in-loop */
const idJob = await insertJob(job.name,
job.command, idProject, job.tags ? job.tags : [], req);
job.command, idProject, job.tags ? job.tags : [], job.geometry, req);
debug(`id_job = ${idJob}`);
// Si il y a des dépendances entre les jobs
if (job.deps) {
Expand Down