Skip to content

Commit

Permalink
Redirect to main screen with filters after toggling attach button
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyosjon09 committed Apr 20, 2021
1 parent 5462e25 commit ffe5572
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/PinflController.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ public function toggleAttached(Request $request)
$pinfl->attached = $request->input('attached');
$pinfl->save();

return redirect('/');
return redirect()->back();
}
}
4 changes: 0 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions public/js/319.js

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions public/js/319.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*!
* Pikaday
*
* Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/Pikaday/Pikaday
*/

//! moment.js

//! moment.js locale configuration
2 changes: 1 addition & 1 deletion public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3805,7 +3805,7 @@ __webpack_require__(/*! alpinejs */ "./node_modules/alpinejs/dist/alpine.js");
__webpack_require__.e(/*! AMD require */ "node_modules_pikaday_pikaday_js").then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(/*! pikaday */ "./node_modules/pikaday/pikaday.js")]; (function (Pikaday) {
var picker = new Pikaday({
field: document.getElementById('birth_date'),
format: "DD.MM.YYYY"
format: 'DD.MM.YYYY'
});
}).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__);}).catch(__webpack_require__.oe);

Expand Down
8 changes: 8 additions & 0 deletions public/js/app.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
6 changes: 5 additions & 1 deletion resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ require('./bootstrap');
require('alpinejs');

require(['pikaday'], function (Pikaday) {
var picker = new Pikaday({ field: document.getElementById('birth_date'),format: "dd.MM.YYYY" });
var picker = new Pikaday(
{
field: document.getElementById('birth_date'),
format: 'DD.MM.YYYY'
});
});
2 changes: 1 addition & 1 deletion resources/views/pinfl/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class="px-4 py-2 shadow-md mt-4 rounded-md bg-gradient-to-t from-blue-700 to-blu
<td class="border-b p-2">{{ $pinfl->birth_date }}</td>
<td class="border-b p-2">{{ str_replace('АНДИЖОН ВИЛОЯТИ ','',$pinfl->birth_place) }}</td>
<td class="border-b w-8 p-2 text-center">
<form action="{{url('/toggle-attach')}}" method="POST">
<form action="{{route('toggle-attach')}}" method="POST">
@csrf
@if($pinfl->attached)
<input type="hidden" name="id" value="{{ $pinfl->id }}">
Expand Down
2 changes: 1 addition & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
})->middleware(['auth'])->name('dashboard');

Route::get('/', [PinflController::class, 'index'])->name('main');
Route::post('/toggle-attach', [PinflController::class, 'toggleAttached']);
Route::post('/', [PinflController::class, 'toggleAttached'])->name('toggle-attach');
// Route::get('/', [PinflController::class, 'filter']);
require __DIR__.'/auth.php';

0 comments on commit ffe5572

Please sign in to comment.