v1.1.0c -Fixed some small things

This commit is contained in:
Neerholt 2020-09-11 09:08:07 +02:00
parent de3ed9c326
commit 78ab6be31a
2 changed files with 12 additions and 14 deletions

View File

@ -99,8 +99,7 @@ class GuidesCategoryController extends Controller
public function update(Request $request, GuidesCategory $guidesCategory)
{
$data = $request->validate([
"name" => "required|max:255",
"guide_articles" => "required",
"guidesCategoryName" => "required|max:255",
]);
$guideCate = Guide::query()->where("id", "=", $guidesCategory->id)->first();

View File

@ -2,21 +2,21 @@
@extends("admin.layout.header")
@section("title")
Lokation - Rediger
Kategori - Rediger
@endsection
@section("path")
<a href="{{route('locations.edit', ['location' => $location ])}}" class="text-white">Rediger lokation</a> /
<a href="{{route('guides-category.edit', ['guidesCategory' => $guidesCate ])}}" class="text-white">Rediger kategori</a> /
@endsection
@section("content")
<h1>Rediger Lokation</h1>
<form method="post" action="{{ route("locations.update", ['location' => $location ]) }}">
<h1>Rediger vejlednings kategori</h1>
<form method="post" action="{{ route("guides-category.update", ['guidesCategory' => $guidesCate ]) }}">
@csrf
@method("put")
<label for="name">Lokationsnavn:</label>
<label hidden id="error" for="errormesseages">Lokation findes allerede</label>
<input type="text" name="name" id="name" value="{{ $location->name }}" required>
<label for="name">Kategori navn:</label>
<label hidden id="error" for="errormesseages">kategorien findes allerede</label>
<input type="text" name="name" id="name" value="{{ $guidesCate->name }}" required>
<input type="submit" id="disable" class="btn btn-dark text-white" value="Rediger">
</form>
@endsection
@ -36,10 +36,9 @@
$value = $('#name').val();
$.ajax({
type: 'get',
url: '{{route('locations.nameCheckUpdate')}}',
data: {'nameCheck':$value, 'id':{{$location->id}}},
url: '{{route('guides-category.nameCheckUpdate')}}',
data: {'nameCheck':$value, 'id':{{$guidesCate->id}}},
success:function (data) {
console.log(data);
if(data){
$("#error").show(100);
$("#error").css('color', 'red');
@ -62,8 +61,8 @@
$value = $(this).val();
$.ajax({
type: 'get',
url: '{{route('locations.nameCheckUpdate')}}',
data: {'nameCheck':$value, 'id':{{$location->id}}},
url: '{{route('guides-category.nameCheckUpdate')}}',
data: {'nameCheck':$value, 'id':{{$guidesCate->id}}},
success:function (data) {
if(data){
$("#error").show(100);