|
|
|
@ -39,11 +39,6 @@ const insertedData = _db.insertIfNotExists( |
|
|
|
.set("telefone", telefone) |
|
|
|
); |
|
|
|
|
|
|
|
const paciente_id = _db.form("paciente") |
|
|
|
.where(_db.where("c_p_f").equal(cpf)) |
|
|
|
.first() |
|
|
|
.get("id"); |
|
|
|
|
|
|
|
for (const convenio_uid of convenios) { |
|
|
|
const convenio_id = _db.form("convenio") |
|
|
|
.where(_db.where("uid").equal(convenio_uid)) |
|
|
|
@ -52,7 +47,7 @@ for (const convenio_uid of convenios) { |
|
|
|
|
|
|
|
_db.insertIfNotExists( |
|
|
|
"paciente_convenio", |
|
|
|
{ paciente_id, convenio_id } |
|
|
|
{ insertedData, convenio_id } |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|