From f99529e499b1181b88a44ebd5a20ab070d206959 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Fri, 29 Sep 2023 18:23:09 +0530 Subject: [PATCH] fix: logged in user as default assigned_to --- frontend/src/components/TaskModal.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/TaskModal.vue b/frontend/src/components/TaskModal.vue index 7be749c9..5cf7bf8e 100644 --- a/frontend/src/components/TaskModal.vue +++ b/frontend/src/components/TaskModal.vue @@ -93,6 +93,7 @@ import { call, } from 'frappe-ui' import { ref, defineModel, h, watch, nextTick } from 'vue' +import { get } from '@vueuse/core' const props = defineProps({ task: { @@ -110,6 +111,8 @@ const tasks = defineModel('reloadTasks') const emit = defineEmits(['updateTask']) +const { getUser } = usersStore() + const title = ref(null) const editMode = ref(false) const _task = ref({ @@ -121,8 +124,6 @@ const _task = ref({ priority: 'Low', }) -const { getUser } = usersStore() - function updateTaskStatus(status) { _task.value.status = status } @@ -132,6 +133,9 @@ function updateTaskPriority(priority) { } async function updateTask(close) { + if (!_task.value.assigned_to) { + _task.value.assigned_to = getUser().email + } if (_task.value.name) { let d = await call('frappe.client.set_value', { doctype: 'CRM Task',