try and catch in password section and wishlist add remove

This commit is contained in:
rahul shukla 2020-01-23 15:32:06 +05:30
parent 956259cc32
commit 2c0b7e4e54
7 changed files with 40 additions and 32 deletions

View File

@ -80,7 +80,7 @@ class ResetPasswordController extends Controller
'email' => trans($response)
]);
} catch(\Exception $e) {
session()->flash('success', trans($e->getMessage()));
session()->flash('error', trans($e->getMessage()));
return redirect()->back();
}

View File

@ -110,7 +110,11 @@ class WishlistController extends Controller
return redirect()->back();
}
} 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();
}

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/shop.js": "/js/shop.js?id=8fc3af6f1d9024329021",
"/css/shop.css": "/css/shop.css?id=6ded8c6338e6cf59a094"
"/css/shop.css": "/css/shop.css?id=617c680f279cb4a73734"
}

View File

@ -202,8 +202,6 @@ input {
}
.add-to-wishlist.already {
pointer-events: none;
.wishlist-icon {
background-image: url('../images/wishlist-added.svg') !important;
}

View File

@ -70,7 +70,7 @@ class ForgetPasswordController extends Controller
['email' => trans($response)]
);
} catch(\Exception $e) {
session()->flash('success', trans($e->getMessage()));
session()->flash('error', trans($e->getMessage()));
return redirect()->back();
}

View File

@ -57,6 +57,7 @@ class ResetPasswordController extends Controller
*/
public function store()
{
try {
$this->validate(request(), [
'token' => 'required',
'email' => 'required|email',
@ -78,6 +79,11 @@ class ResetPasswordController extends Controller
->withErrors([
'email' => trans($response)
]);
} catch(\Exception $e) {
session()->flash('error', trans($e->getMessage()));
return redirect()->back();
}
}
/**