Skip to content

Commit

Permalink
fix(refresh-siret): refresh siret si pas de siren (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminDNUM authored Jun 20, 2024
1 parent 3705c6d commit 533c3e3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/backend/src/controllers/organisme/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ module.exports = async function post(req, res, next) {
organismeId,
);
}
} else {
if (type === "personne_morale") {
await Organisme.update(type, parametre, organismeId);
}
}

await Organisme.link(userId, organismeId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,12 @@
</div>

<DsfrFieldset v-if="props.showButtons" class="fr-fieldset">
<DsfrButton id="next-step" @click.prevent="next">Suivant</DsfrButton>
<DsfrButton
id="next-step"
:disabled="!siren || !siret"
@click.prevent="next"
>Suivant</DsfrButton
>
</DsfrFieldset>
</div>
</template>
Expand Down Expand Up @@ -528,7 +533,7 @@ async function searchOrganismeBySiret() {
async function searchOrganisme() {
log.i("searchOrganisme - In");
const organismeFound = await searchOrganismeBySiret();
if (!organismeFound) {
if (!organismeFound || !organismeFound?.personneMorale?.siren) {
log.d("appel API INSEE");
await searchApiInsee();
}
Expand Down

0 comments on commit 533c3e3

Please sign in to comment.