replaced clients/s with customer/s (2)

This commit is contained in:
Johanna Kuehner
2024-03-04 20:07:31 +01:00
parent 889eb3571f
commit fa29921afe
13 changed files with 77 additions and 77 deletions

View File

@ -5,8 +5,8 @@
<input v-if="editable" v-model="sol.solutionName" @change="updateSolution()"
:class="['data', 'solution-name-input', darkMode ? 'h2-darkmode' : 'h2-lightmode', darkMode ? 'h2-input-darkmode' : 'h2-input-lightmode', 'input']">
<div class="solution-data">
<div class="client-asset">
<div class="data-field" id="client">
<div class="customer-asset">
<div class="data-field" id="customer">
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Customer:</pre>
<pre v-if="!editable"
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ sol.customer }}</pre>
@ -163,8 +163,8 @@ const newDescription = ref('');
const newNotes = ref('');
const newLastView = ref('');
const newUser = ref('');
const changedClientId = computed(() => store.state.changedClientId);
const clientChanged = computed(() => store.state.clientChanged);
const changedCustomerId = computed(() => store.state.changedCustomerId);
const customerChanged = computed(() => store.state.customerChanged);
// get solution from id
const getSolutionById = async () => {
@ -178,28 +178,28 @@ const getSolutionById = async () => {
console.log(err.response.statusText);
}
}
await getConfigItemsFromClient();
await getConfigItemsFromCustomer();
}
//get all config items from the selected client
const getConfigItemsFromClient = async () => {
//get all config items from the selected customer
const getConfigItemsFromCustomer = async () => {
if (!addBool.value) {
try {
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCIFromClient/${sol.value.customerID}`);
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCIFromCustomer/${sol.value.customerID}`);
configItems.value = response.data;
} catch (err) {
console.log(err.response.statusText);
}
} else {
try {
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCIFromClient/${changedClientId.value}`);
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCIFromCustomer/${changedCustomerId.value}`);
configItems.value = response.data;
} catch (err) {
console.log(err.response.statusText);
}
}
if (clientChanged.value) {
store.commit('toggleClientChanged');
if (customerChanged.value) {
store.commit('toggleCustomerChanged');
}
}
@ -308,8 +308,8 @@ const updateCustomerID = async () => {
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCustomerByName/${sol.value.customer}`);
customer.value = response.data;
sol.value.customerID = customer.value.customerID;
store.commit('toggleClientChanged');
store.commit('toggleClientId', sol.value.customerID);
store.commit('toggleCustomerChanged');
store.commit('toggleCustomerId', sol.value.customerID);
} catch (err) {
console.log(err.response.statusText);
}
@ -321,13 +321,13 @@ const updateNewCustomerID = async () => {
try {
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCustomerByName/${newCustomer.value}`);
newCustomerID.value = response.data.customerID;
store.commit('toggleClientChanged');
store.commit('toggleClientId', newCustomerID.value);
store.commit('toggleCustomerChanged');
store.commit('toggleCustomerId', newCustomerID.value);
} catch (err) {
console.log(err.response.statusText);
}
updateSol();
await getConfigItemsFromClient();
await getConfigItemsFromCustomer();
}
// include delay to avoid 503 error
@ -338,7 +338,7 @@ const triggerBackendCallsWithDelay = async (fetchDataFunc) => {
}
watch(deleteBool, confirmDeleteSolution);
watch(clientChanged, getSolutionById);
watch(customerChanged, getSolutionById);
onMounted(() => {
getSolutionById();