From 5d93cba5099b9ee4731bbc3ecf2e9364805d3bd4 Mon Sep 17 00:00:00 2001 From: Aji Kamaludin Date: Fri, 2 Jun 2023 10:11:42 +0700 Subject: [PATCH] bit fix --- app/Http/Controllers/Customer/ProfileController.php | 5 ++--- resources/js/Layouts/CustomerLayout.jsx | 6 +++--- resources/js/Pages/Home/Profile/Form.jsx | 11 +++++++++-- resources/js/Pages/Home/Profile/Index.jsx | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/Customer/ProfileController.php b/app/Http/Controllers/Customer/ProfileController.php index 704ba51..9a82aa8 100644 --- a/app/Http/Controllers/Customer/ProfileController.php +++ b/app/Http/Controllers/Customer/ProfileController.php @@ -26,7 +26,7 @@ class ProfileController extends Controller 'name' => 'string|required', 'address' => 'string|required', 'phone' => 'string|required|numeric', - 'username' => 'string|required|min:5|alpha_dash|unique:customers,username,'.$customer->id, + 'username' => 'string|required|min:5|alpha_dash|unique:customers,username,' . $customer->id, 'password' => 'nullable|string|min:8|confirmed', 'image' => 'nullable|image', ]); @@ -51,7 +51,6 @@ class ProfileController extends Controller 'password' => $customer->password, ]); - redirect()->route('customer.profile.show') - ->with('message', ['type' => 'success', 'message' => 'profile updateded']); + session()->flash('message', ['type' => 'success', 'message' => 'profile updateded']); } } diff --git a/resources/js/Layouts/CustomerLayout.jsx b/resources/js/Layouts/CustomerLayout.jsx index dd8557a..ca0e4a4 100644 --- a/resources/js/Layouts/CustomerLayout.jsx +++ b/resources/js/Layouts/CustomerLayout.jsx @@ -26,11 +26,11 @@ export default function CustomerLayout({ children }) { } return ( -
-
+
+
{children}
-
+
handleOnClick('home.index')} diff --git a/resources/js/Pages/Home/Profile/Form.jsx b/resources/js/Pages/Home/Profile/Form.jsx index a8716ce..6238ea2 100644 --- a/resources/js/Pages/Home/Profile/Form.jsx +++ b/resources/js/Pages/Home/Profile/Form.jsx @@ -37,7 +37,7 @@ export default function Index({ auth: { user }, flash }) { const handleSubmit = () => { post(route('customer.profile.show'), { onSuccess: () => - setTimeout(router.get(route(route().current())), 3000), + setTimeout(() => router.get(route(route().current())), 3000), }) } @@ -46,7 +46,7 @@ export default function Index({ auth: { user }, flash }) { handleSubmit() } } - console.log(user) + return ( @@ -66,6 +66,7 @@ export default function Index({ auth: { user }, flash }) { onChange={handleOnChange} error={errors.fullname} onKeyDownCapture={(e) => handleKeyDown(e)} + label="nama lengkap" />
@@ -76,6 +77,7 @@ export default function Index({ auth: { user }, flash }) { onChange={handleOnChange} error={errors.name} onKeyDownCapture={(e) => handleKeyDown(e)} + label="nama panggilan" />
handleKeyDown(e)} formClassName={'pl-10'} + label="whatsapp" />