Fix asignacion y create
This commit is contained in:
parent
720fb660af
commit
8dcfa647b0
@ -63,7 +63,7 @@ watch(() => form.start_date, () => {
|
||||
const submit = () => {
|
||||
form.transform(data => ({
|
||||
...data,
|
||||
users: form.users = users.value.map(u => u.id)
|
||||
users: users.value.filter(u => u.selected).map(u => u.id)
|
||||
})).post(apiTo('assign-course', { course: vroute.params.id }), {
|
||||
onSuccess: () => {
|
||||
Notify.success(Lang('register.assign.onSuccess'))
|
||||
@ -77,12 +77,7 @@ onMounted(() => {
|
||||
api.get(apiTo('show', { course: vroute.params.id }), {
|
||||
onSuccess: (r) => {
|
||||
course.value = r.course
|
||||
|
||||
api.catalog({
|
||||
'user:byDepartment': r.course.department?.id || null
|
||||
}, {
|
||||
onSuccess: (r) => users.value = r['user:byDepartment'] ?? []
|
||||
});
|
||||
users.value = r.course.users ?? []
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@ -45,7 +45,7 @@ function submit() {
|
||||
...data,
|
||||
department_id: form.department_id?.id,
|
||||
cost_currency: form.cost_currency?.id,
|
||||
users: form.users = users.value.map(u => u.id)
|
||||
users: users.value.filter(u => u.selected).map(u => u.id)
|
||||
})).post(apiTo('store'), {
|
||||
onSuccess: () => {
|
||||
Notify.success(Lang('register.create.onSuccess'))
|
||||
@ -97,12 +97,12 @@ onMounted(() => {
|
||||
title="Solicitud de Nuevo Curso"
|
||||
>
|
||||
<RouterLink :to="viewTo({ name: 'index' })">
|
||||
<IconButton
|
||||
class="text-white"
|
||||
icon="arrow_back"
|
||||
:title="$t('return')"
|
||||
filled
|
||||
/>
|
||||
<IconButton
|
||||
class="text-white"
|
||||
icon="arrow_back"
|
||||
:title="$t('return')"
|
||||
filled
|
||||
/>
|
||||
</RouterLink>
|
||||
</PageHeader>
|
||||
|
||||
@ -183,6 +183,7 @@ onMounted(() => {
|
||||
:onError="form.errors.duration"
|
||||
type="number"
|
||||
min="1"
|
||||
required
|
||||
/>
|
||||
<Input
|
||||
v-model="form.url"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user