Skip to content

Commit

Permalink
fix: poour afficher correctement le salaire (#543)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ornella452 authored Sep 26, 2024
1 parent 5f66dc6 commit 8d74007
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import propTypes from 'prop-types';
import dayjs from 'dayjs';
import { formatTypeDeContrat } from '../../../../../utils/formatagesUtils';
import { ModalMode } from '../../../../../utils/enumUtils';
import { getDemandeInitiee } from '../../../structure/utils/functionUtils';
import { getDemandeInitiee, getSalaire } from '../../../structure/utils/functionUtils';

const CardsRenouvellement = ({ miseEnRelation, setOpenModal, urlDossierDS, handleOpenModalContrat }) => {
const demandeInitiee = getDemandeInitiee(miseEnRelation);
Expand Down Expand Up @@ -78,8 +78,7 @@ const CardsRenouvellement = ({ miseEnRelation, setOpenModal, urlDossierDS, handl
<div>
<strong className="fr-text--md">Salaire brut mensuel</strong><br />
<span className="fr-text--regular fr-text--md">
{miseEnRelation?.salaire || demandeInitiee?.salaireSouhaitee ?
`${demandeInitiee?.salaireSouhaitee ? demandeInitiee?.salaireSouhaitee : miseEnRelation?.salaire} €` : '-'}
{getSalaire(miseEnRelation) === '' ? '-' : `${getSalaire(miseEnRelation)} €` }
</span>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/views/connected/structure/utils/functionUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export function getDateFin(conseiller) {

export function getSalaire(conseiller) {
const demandeInitiee = getDemandeInitiee(conseiller);
if (demandeInitiee?.salaireSouhaitee) {
if (demandeInitiee?.salaireSouhaitee || demandeInitiee?.salaireSouhaitee === '') {
return String(demandeInitiee.salaireSouhaitee);
} else if (conseiller?.salaire) {
return String(conseiller?.salaire);
Expand Down

0 comments on commit 8d74007

Please sign in to comment.