0
0
Fork 0

refs #6553 fix reactivateWorker

This commit is contained in:
Carlos Satorres 2024-09-13 13:46:53 +02:00
parent 04d30186c2
commit f903432e74
1 changed files with 8 additions and 15 deletions

View File

@ -13,20 +13,11 @@ const tableRef = ref();
const entityId = computed(() => route.params.id); const entityId = computed(() => route.params.id);
const quasar = useQuasar(); const quasar = useQuasar();
async function reactivateWorker(data) { async function reactivateWorker() {
console.log('value: ', data.updates[0].data.ended); const hasToReactive = tableRef.value.CrudModelRef.formData.find(
console.log('data: ', entityId.value); (data) => !data.ended
// const filter = { );
// where: { id: entityId.value }, if (hasToReactive) {
// };
// console.log('filter: ', filter);
const { worker } = await axios.get(`Workers`, {
params: {
filter: JSON.stringify({ id: entityId.value }),
},
});
console.log('worker', worker);
if (!data.updates[0].data.ended) {
quasar quasar
.dialog({ .dialog({
message: t('Do you want to reactivate the user?'), message: t('Do you want to reactivate the user?'),
@ -37,7 +28,9 @@ async function reactivateWorker(data) {
cancel: true, cancel: true,
}) })
.onOk(async () => { .onOk(async () => {
worker.isDisable = false; await axios.patch(`Workers/${entityId.value}`, {
isDisable: false,
});
}); });
} }
} }