Skip to content

Commit

Permalink
fix: properly update VAT before doing a check
Browse files Browse the repository at this point in the history
  • Loading branch information
kelsos committed Jan 6, 2025
1 parent b6645e9 commit 7bf13d5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions components/account/home/AccountInformation.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { useVuelidate } from '@vuelidate/core';
import { required } from '@vuelidate/validators';
import { requiredUnless } from '@vuelidate/validators';
import { get, objectOmit, set } from '@vueuse/core';
import { storeToRefs } from 'pinia';
import { useVatCheck } from '~/composables/use-vat-check';
Expand Down Expand Up @@ -29,9 +29,11 @@ const remainingTime = ref<number>(0);
const { account } = storeToRefs(store);
const movedOffline = computed<boolean>(() => get(account)?.address.movedOffline ?? false);
const rules = {
firstName: { required },
lastName: { required },
firstName: { required: requiredUnless(movedOffline) },
lastName: { required: requiredUnless(movedOffline) },
companyName: {},
vatId: {},
};
Expand Down Expand Up @@ -59,7 +61,6 @@ const {
},
} = useRuntimeConfig();
const movedOffline = computed<boolean>(() => get(account)?.address.movedOffline ?? false);
const isVatIdValid = computed<boolean>(() => get(account)?.vatIdStatus === VatIdStatus.VALID || false);
const vatHint = computed<string>(() => {
Expand Down Expand Up @@ -140,6 +141,7 @@ async function update() {
async function handleCheckVATClick() {
set(loadingCheck, true);
await update();
const checkResult = await checkVAT();
await refreshVATCheckStatus();
Expand Down

0 comments on commit 7bf13d5

Please sign in to comment.