translations users & directory
This commit is contained in:
@@ -3,6 +3,7 @@ import { ref } from "vue";
|
||||
import { getBudgets, getCompany, updateBudget, updateCompany, deleteBudget, createBudget, getUsers, updateUser, createUser, deleteUser, getLocations, createLocation, updateLocation, deleteLocation } from "../services/company";
|
||||
import api from "../lib/axios";
|
||||
import { saveProposal, updateProposal } from "../services/vehicles";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
||||
export const useCompanyStore = defineStore('company', () => {
|
||||
|
||||
@@ -22,6 +23,7 @@ export const useCompanyStore = defineStore('company', () => {
|
||||
const proposalsTotal = ref(0);
|
||||
const proposalsCurrentPage = ref(0)
|
||||
const loading = ref(false);
|
||||
const { t } = useI18n();
|
||||
|
||||
const getCompanyData = async() => {
|
||||
const companyId = localStorage.getItem('id');
|
||||
@@ -81,7 +83,7 @@ export const useCompanyStore = defineStore('company', () => {
|
||||
}
|
||||
return 'success';
|
||||
} else {
|
||||
return 'Algo salio mal, intente más tarde';
|
||||
return t('errors.generic');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +110,7 @@ export const useCompanyStore = defineStore('company', () => {
|
||||
}
|
||||
return 'success';
|
||||
} else {
|
||||
return 'Algo salio mal, intente más tarde';
|
||||
return t('errors.generic');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,14 +123,14 @@ export const useCompanyStore = defineStore('company', () => {
|
||||
}
|
||||
return 'success';
|
||||
} else {
|
||||
return 'Algo salio mal, intente más tarde';
|
||||
return t('errors.generic');
|
||||
}
|
||||
}
|
||||
|
||||
const editCompany = async(formData) => {
|
||||
const data = await updateCompany(formData);
|
||||
if(data === null) {
|
||||
return 'Algo salio mal, intente más tarde';
|
||||
return t('errors.generic');
|
||||
} else {
|
||||
company.value = {
|
||||
...company.value,
|
||||
@@ -190,7 +192,7 @@ export const useCompanyStore = defineStore('company', () => {
|
||||
proposalsTotal.value++;
|
||||
return 'success';
|
||||
} else {
|
||||
return 'Algo salio mal, intente más tarde';
|
||||
return t('errors.generic');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,7 +207,7 @@ export const useCompanyStore = defineStore('company', () => {
|
||||
};
|
||||
return 'success';
|
||||
} else {
|
||||
return 'Algo salio mal, intente más tarde';
|
||||
return t('errors.generic');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,7 +252,7 @@ export const useCompanyStore = defineStore('company', () => {
|
||||
return 'No se pudo actualizar presupuesto, intente mas tarde';
|
||||
}
|
||||
} catch (error) {
|
||||
return 'Algo salio mal, intente más tarde';
|
||||
return t('errors.generic');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +270,7 @@ export const useCompanyStore = defineStore('company', () => {
|
||||
return 'No se pudo agregar presupuesto, intente mas tarde';
|
||||
}
|
||||
} catch (error) {
|
||||
return 'Algo salio mal, intente más tarde';
|
||||
return t('errors.generic');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,7 +334,7 @@ export const useCompanyStore = defineStore('company', () => {
|
||||
})
|
||||
return 'success';
|
||||
} else {
|
||||
return 'Algo salio mal, intente más tarde';
|
||||
return t('errors.generic');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -357,7 +359,7 @@ export const useCompanyStore = defineStore('company', () => {
|
||||
}
|
||||
return 'success';
|
||||
} else {
|
||||
return 'Algo salio mal, intente más tarde';
|
||||
return t('errors.generic');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,7 +373,7 @@ export const useCompanyStore = defineStore('company', () => {
|
||||
|
||||
return 'success';
|
||||
} else {
|
||||
return 'Algo salio mal, intente más tarde';
|
||||
return t('errors.generic');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user