clean code
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Alex Moreno 2024-06-06 09:33:01 +02:00
parent 395eb6bed7
commit aee3c67ee0
4 changed files with 10 additions and 14 deletions

View File

@ -196,13 +196,13 @@ async function save() {
if ($props.urlCreate) notify('globals.dataCreated', 'positive');
hasChanges.value = false;
isLoading.value = false;
updateAndEmit(response?.data, 'onDataSaved');
} catch (err) {
console.error(err);
notify('errors.writeRequest', 'negative');
} finally {
hasChanges.value = false;
isLoading.value = false;
}
}
@ -239,6 +239,7 @@ function updateAndEmit(val, evt) {
originalData.value = val && JSON.parse(JSON.stringify(val));
if (!$props.url) arrayData.store.data = val;
console.log('$props.model: ', $props.model);
emit(evt, state.get($props.model));
}

View File

@ -82,7 +82,7 @@ const navigate = (event, id) => {
</QDrawer>
<QPage class="column items-center q-pa-md">
<div class="vn-card-list">
<VnPaginate data-key="RolesList" url="VnRoles" auto-load>
<VnPaginate data-key="RolesList" url="VnRoles">
<template #body="{ rows }">
<CardList
:id="row.id"

View File

@ -60,6 +60,7 @@ const redirectToRoleSummary = (id) =>
data-key="InheritedRoles"
:filter="filter"
:url="urlPath"
:limit="0"
auto-load
>
<template #body>

View File

@ -8,14 +8,6 @@ import VnInput from 'src/components/common/VnInput.vue';
const router = useRouter();
const { t } = useI18n();
const defaultInitialData = {
name: null,
description: null,
};
const redirectToRoleBasicData = (_, { id }) =>
router.push({ name: 'RoleBasicData', params: { id } });
</script>
<template>
<FormModelPopup
@ -23,8 +15,10 @@ const redirectToRoleBasicData = (_, { id }) =>
ref="formModelPopupRef"
url-create="VnRoles"
model="VnRole"
:form-initial-data="defaultInitialData"
@on-data-saved="redirectToRoleBasicData"
:form-initial-data="{}"
@on-data-saved="
(_, { id }) => router.push({ name: 'RoleBasicData', params: { id } })
"
>
<template #form-inputs="{ data }">
<VnRow class="row q-gutter-md q-mb-md">