revert: VnVisibleColumn try catch
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
This commit is contained in:
parent
9019d4ff90
commit
9d7f2b95e8
|
@ -57,27 +57,31 @@ async function getConfig(url, filter) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchViewConfigData() {
|
async function fetchViewConfigData() {
|
||||||
const defaultFilter = {
|
try {
|
||||||
where: { tableCode: $props.tableCode },
|
const defaultFilter = {
|
||||||
};
|
where: { tableCode: $props.tableCode },
|
||||||
|
};
|
||||||
|
|
||||||
const userConfig = await getConfig('UserConfigViews', {
|
const userConfig = await getConfig('UserConfigViews', {
|
||||||
where: {
|
where: {
|
||||||
...defaultFilter.where,
|
...defaultFilter.where,
|
||||||
...{ userFk: user.value.id },
|
...{ userFk: user.value.id },
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (userConfig) {
|
if (userConfig) {
|
||||||
initialUserConfigViewData.value = userConfig;
|
initialUserConfigViewData.value = userConfig;
|
||||||
setUserConfigViewData(userConfig.configuration);
|
setUserConfigViewData(userConfig.configuration);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultConfig = await getConfig('DefaultViewConfigs', defaultFilter);
|
const defaultConfig = await getConfig('DefaultViewConfigs', defaultFilter);
|
||||||
if (defaultConfig) {
|
if (defaultConfig) {
|
||||||
setUserConfigViewData(defaultConfig.columns);
|
setUserConfigViewData(defaultConfig.columns);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Error fetching config view data', err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,6 +92,7 @@ async function saveConfig() {
|
||||||
setUserConfigViewData(configuration, true);
|
setUserConfigViewData(configuration, true);
|
||||||
if (!$props.tableCode) return popupProxyRef.value.hide();
|
if (!$props.tableCode) return popupProxyRef.value.hide();
|
||||||
|
|
||||||
|
try {
|
||||||
const params = {};
|
const params = {};
|
||||||
// Si existe una view config del usuario hacemos un update si no la creamos
|
// Si existe una view config del usuario hacemos un update si no la creamos
|
||||||
if (initialUserConfigViewData.value) {
|
if (initialUserConfigViewData.value) {
|
||||||
|
@ -118,7 +123,10 @@ async function saveConfig() {
|
||||||
}
|
}
|
||||||
notify('globals.dataSaved', 'positive');
|
notify('globals.dataSaved', 'positive');
|
||||||
popupProxyRef.value.hide();
|
popupProxyRef.value.hide();
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Error saving user view config', err);
|
||||||
|
notify('errors.writeRequest', 'negative');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
Loading…
Reference in New Issue