fix: logged in user as default assigned_to

This commit is contained in:
Shariq Ansari 2023-09-29 18:23:09 +05:30
parent 7222fa9279
commit f99529e499

View File

@ -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',