Skip to content

Commit

Permalink
fix projects edit
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghelupu17 committed Aug 18, 2023
1 parent 7c16b37 commit 556a330
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/Http/Controllers/Ngo/ProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ public function update(Request $request, Project $project)
if ($request->has('counties')) {
$project->counties()->sync(collect($request->get('counties'))->pluck('id'));
}
if ($request->has('categories')) {
$project->categories()->sync(collect($request->get('categories'))->pluck('id'));
}
$project->update($request->all());
return redirect()->back()->with('success_message', 'Project updated.');
}
Expand Down
3 changes: 2 additions & 1 deletion resources/js/Pages/AdminOng/Projects/EditProject.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
<dt class="col-span-12 text-base font-medium leading-6 text-gray-700 md:col-span-5">{{ $t('project_category_label') }}</dt>
<dt class="col-span-12 text-base font-medium leading-6 text-gray-700 md:col-span-6">{{ form.categories.map(item=>item.name).join(', ') }}</dt>
<EditModal
@action="editField('category')"
@action="editField('categories')"
class="flex justify-end col-span-1"
>

Expand Down Expand Up @@ -421,6 +421,7 @@
let newForm = useForm({
[field]: form[field]
})
console.log(newForm);
newForm.put(route('admin.ong.project.update', project.value.id))
}
Expand Down

0 comments on commit 556a330

Please sign in to comment.