Commit 01d0adfb9f3977601a737b14b270a94a2cc0e06d

Authored by Андрей Ларионов
Exists in master

Merge branch 'master' of http://gitlab.nologostudio.ru/alarionov/rekamore-su

Showing 3 changed files Side-by-side Diff

resources/views/admin/education/form.blade.php
1 1 @csrf
2 2  
3   -@isset($education)
4   - @method('PUT')
5   -@endisset
6   -
  3 +@method('PUT')
7 4 <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800">
8 5 <form method="POST" action="{{ route('admin.education.update', ['education' => $education->id]) }}" enctype="multipart/form-data">
9 6 <label class="block text-sm">
resources/views/admin/education/index.blade.php
... ... @@ -8,7 +8,8 @@
8 8 console.log('click button');
9 9 let id = e.target.id;
10 10 let form = document.getElementById("form_modal_del");
11   - form.action = "<?=$_SERVER['APP_URL']?>admin/education/"+e.target.getAttribute('data-education');
  11 + let action_template = form.getAttribute("data-action-template");
  12 + form.action = action_template + "/" + e.target.getAttribute('data-education');
12 13 //document.getElementById("title_modal").innerHTML = id;
13 14 console.log(e.target.getAttribute('data-education'));
14 15 });
resources/views/admin/education/modal.blade.php
... ... @@ -68,7 +68,7 @@
68 68 >
69 69 Отмена
70 70 </button>
71   - <form id="form_modal_del" name="form_modal_del" action="admin/education/{education}" method="POST">
  71 + <form id="form_modal_del" name="form_modal_del" data-action-template="{{ route('admin.education.index') }}" action="" method="POST">
72 72 @csrf
73 73 @method('DELETE')
74 74 <button