refs #4797 refactor(workerNotification): const url_key
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
9993344d70
commit
54276b2460
|
@ -19,16 +19,17 @@ const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const entityId = computed(() => $props.id || route.params.id);
|
const entityId = computed(() => $props.id || route.params.id);
|
||||||
|
const URL_KEY = 'NotificationSubscriptions';
|
||||||
const active = ref();
|
const active = ref();
|
||||||
const available = ref();
|
const available = ref();
|
||||||
|
|
||||||
async function toggleNotification(notification) {
|
async function toggleNotification(notification) {
|
||||||
try {
|
try {
|
||||||
if (!notification.active) {
|
if (!notification.active) {
|
||||||
await axios.delete(`NotificationSubscriptions/${notification.id}`);
|
await axios.delete(`${URL_KEY}/${notification.id}`);
|
||||||
swapEntry(active.value, available.value, notification.notificationFk);
|
swapEntry(active.value, available.value, notification.notificationFk);
|
||||||
} else {
|
} else {
|
||||||
const { data } = await axios.post(`NotificationSubscriptions`, {
|
const { data } = await axios.post(URL_KEY, {
|
||||||
notificationFk: notification.notificationFk,
|
notificationFk: notification.notificationFk,
|
||||||
userFk: entityId.value,
|
userFk: entityId.value,
|
||||||
});
|
});
|
||||||
|
@ -63,8 +64,8 @@ function setNotifications(data) {
|
||||||
<template>
|
<template>
|
||||||
<CrudModel
|
<CrudModel
|
||||||
auto-load
|
auto-load
|
||||||
data-key="NotificationSubscriptions"
|
:data-key="URL_KEY"
|
||||||
:url="`NotificationSubscriptions/${entityId}/getList`"
|
:url="`${URL_KEY}/${entityId}/getList`"
|
||||||
:default-reset="false"
|
:default-reset="false"
|
||||||
:default-remove="false"
|
:default-remove="false"
|
||||||
:default-save="false"
|
:default-save="false"
|
||||||
|
|
Loading…
Reference in New Issue