Skip to content

Commit

Permalink
fix: rendre reponse kyc obligatoire (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
OCTO-GUIC authored Feb 21, 2024
1 parent 19f69bc commit 39fc3b5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/pages/PageQuestionKyc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
:default-value="reponse.toString()"
/>
</div>
<button class="fr-btn fr-btn--lg" title="Valider" :disabled="reponse === ''">Valider</button>
<button class="fr-btn fr-btn--lg" title="Valider" :disabled="isButtonDisabled">Valider</button>
</form>
<KYCFin v-else :phrase-point-a-gagner="questionViewModel!.points" :a-deja-repondu="aDejaRepondu" />
</div>
Expand All @@ -43,7 +43,7 @@
</template>

<script setup lang="ts">
import { onMounted, ref } from 'vue';
import { computed, onMounted, ref } from 'vue';
import { useRoute } from 'vue-router';
import FilDAriane from '@/components/dsfr/FilDAriane.vue';
import { RecupererQuestionUsecase } from '@/kyc/recupererQuestionUsecase';
Expand All @@ -67,6 +67,13 @@
const utilisateurId = utilisateurStore().utilisateur.id;
const isButtonDisabled = computed(() => {
if (!reponse.value) return true;
if (reponse.value === '') return true;
if (reponse.value.length < 1) return true;
return false;
});
onMounted(async () => {
const recupereQuestionUsecase = new RecupererQuestionUsecase(new QuestionRepositoryAxios());
await recupereQuestionUsecase.execute(
Expand Down

0 comments on commit 39fc3b5

Please sign in to comment.