Merge pull request #2125 from rahulshukla-webkul/development
try and catch in password section and wishlist add remove
This commit is contained in:
commit
5a63b48332
|
|
@ -80,7 +80,7 @@ class ResetPasswordController extends Controller
|
||||||
'email' => trans($response)
|
'email' => trans($response)
|
||||||
]);
|
]);
|
||||||
} catch(\Exception $e) {
|
} catch(\Exception $e) {
|
||||||
session()->flash('success', trans($e->getMessage()));
|
session()->flash('error', trans($e->getMessage()));
|
||||||
|
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,11 @@ class WishlistController extends Controller
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
session()->flash('warning', trans('customer::app.wishlist.already'));
|
$this->wishlistRepository->findOneWhere([
|
||||||
|
'product_id' => $data['product_id']
|
||||||
|
])->delete();
|
||||||
|
|
||||||
|
session()->flash('success', trans('customer::app.wishlist.removed'));
|
||||||
|
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"/js/shop.js": "/js/shop.js?id=8fc3af6f1d9024329021",
|
"/js/shop.js": "/js/shop.js?id=8fc3af6f1d9024329021",
|
||||||
"/css/shop.css": "/css/shop.css?id=6ded8c6338e6cf59a094"
|
"/css/shop.css": "/css/shop.css?id=617c680f279cb4a73734"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -202,8 +202,6 @@ input {
|
||||||
}
|
}
|
||||||
|
|
||||||
.add-to-wishlist.already {
|
.add-to-wishlist.already {
|
||||||
pointer-events: none;
|
|
||||||
|
|
||||||
.wishlist-icon {
|
.wishlist-icon {
|
||||||
background-image: url('../images/wishlist-added.svg') !important;
|
background-image: url('../images/wishlist-added.svg') !important;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ class ForgetPasswordController extends Controller
|
||||||
['email' => trans($response)]
|
['email' => trans($response)]
|
||||||
);
|
);
|
||||||
} catch(\Exception $e) {
|
} catch(\Exception $e) {
|
||||||
session()->flash('success', trans($e->getMessage()));
|
session()->flash('error', trans($e->getMessage()));
|
||||||
|
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,27 +57,33 @@ class ResetPasswordController extends Controller
|
||||||
*/
|
*/
|
||||||
public function store()
|
public function store()
|
||||||
{
|
{
|
||||||
$this->validate(request(), [
|
try {
|
||||||
'token' => 'required',
|
$this->validate(request(), [
|
||||||
'email' => 'required|email',
|
'token' => 'required',
|
||||||
'password' => 'required|confirmed|min:6',
|
'email' => 'required|email',
|
||||||
]);
|
'password' => 'required|confirmed|min:6',
|
||||||
|
|
||||||
$response = $this->broker()->reset(
|
|
||||||
request(['email', 'password', 'password_confirmation', 'token']), function ($admin, $password) {
|
|
||||||
$this->resetPassword($admin, $password);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($response == Password::PASSWORD_RESET) {
|
|
||||||
return redirect()->route($this->_config['redirect']);
|
|
||||||
}
|
|
||||||
|
|
||||||
return back()
|
|
||||||
->withInput(request(['email']))
|
|
||||||
->withErrors([
|
|
||||||
'email' => trans($response)
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$response = $this->broker()->reset(
|
||||||
|
request(['email', 'password', 'password_confirmation', 'token']), function ($admin, $password) {
|
||||||
|
$this->resetPassword($admin, $password);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($response == Password::PASSWORD_RESET) {
|
||||||
|
return redirect()->route($this->_config['redirect']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return back()
|
||||||
|
->withInput(request(['email']))
|
||||||
|
->withErrors([
|
||||||
|
'email' => trans($response)
|
||||||
|
]);
|
||||||
|
} catch(\Exception $e) {
|
||||||
|
session()->flash('error', trans($e->getMessage()));
|
||||||
|
|
||||||
|
return redirect()->back();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue