Formatting and small changes

This commit is contained in:
William Buezas 2024-08-19 08:21:23 -03:00
parent 25f4f822b4
commit 05d735702e
4 changed files with 20 additions and 19 deletions

View File

@ -21,7 +21,7 @@ const onRequestError = error => {
};
const onResponseError = error => {
let message = '';
let message = error.message;
const response = error.response;
const responseData = response && response.data;
@ -35,12 +35,6 @@ const onResponseError = error => {
return Promise.reject(error);
};
const jApiErrorInterceptor = error => {
if (error.message) {
notify(error.message, 'negative');
}
};
export default boot(({ app }) => {
const userStore = useUserStore();
function addToken(config) {
@ -53,7 +47,7 @@ export default boot(({ app }) => {
api.interceptors.response.use(response => response, onResponseError);
jApi.use(addToken);
jApi.useErrorInterceptor(jApiErrorInterceptor);
jApi.useErrorInterceptor(onResponseError);
// for use inside Vue files (Options API) through this.$axios and this.$api

View File

@ -37,7 +37,7 @@ const repeatPassword = ref('');
const passwordRequirements = ref(null);
const formData = ref({
userId: userStore.user.id,
userId: userStore?.user?.id,
oldPassword: '',
newPassword: ''
});
@ -102,12 +102,12 @@ onMounted(async () => {
<VnForm
ref="vnFormRef"
:title="t('changePassword')"
:formInitialData="formData"
:saveFn="changePassword"
showBottomActions
:defaultActions="false"
:form-initial-data="formData"
:save-fn="changePassword"
show-bottom-actions
:default-actions="false"
style="max-width: 300px"
@onDataSaved="onPasswordChanged()"
@on-data-saved="onPasswordChanged()"
>
<template #form>
<VnInput
@ -161,7 +161,13 @@ onMounted(async () => {
flat
@click="passwordRequirementsDialogRef.show()"
/>
<QBtn :label="t('modify')" type="submit" rounded no-caps flat />
<QBtn
:label="t('modify')"
rounded
no-caps
flat
@click="vnFormRef.submit()"
/>
</template>
</VnForm>
<QDialog ref="passwordRequirementsDialogRef">

View File

@ -20,7 +20,7 @@ const vnFormRef = ref(null);
const changePasswordFormDialog = ref(null);
const showChangePasswordForm = ref(false);
const langOptions = ref([]);
const pks = computed(() => ({ id: userStore.user.id }));
const pks = computed(() => ({ id: userStore?.user?.id }));
const fetchConfigDataSql = {
query: `
SELECT u.id, u.name, u.email, u.nickname,
@ -67,11 +67,11 @@ onMounted(() => fetchLanguagesSql());
<VnForm
ref="vnFormRef"
:title="t('personalInformation')"
:fetchFormDataSql="fetchConfigDataSql"
:fetch-form-data-sql="fetchConfigDataSql"
:pks="pks"
table="myUser"
schema="account"
:defaultActions="false"
:default-actions="false"
>
<template #form="{ data }">
<VnInput
@ -98,7 +98,7 @@ onMounted(() => fetchLanguagesSql());
option-label="name"
option-value="code"
:options="langOptions"
@update:modelValue="vnFormRef.submit()"
@update:model-value="vnFormRef.submit()"
/>
</template>
</VnForm>

View File

@ -137,6 +137,7 @@ const onConfirmPay = async () => {
class="full-width"
type="number"
min="0"
:max="debt * -1"
/>
</template>
</VnConfirm>