From 071097f3c1fa7f149016e11e8f71c1409a43e769 Mon Sep 17 00:00:00 2001 From: Aji Kamaludin Date: Thu, 8 Jun 2023 17:59:14 +0700 Subject: [PATCH] bit fix --- README.md | 2 ++ app/Http/Controllers/Customer/AuthController.php | 6 +++++- app/Http/Controllers/VoucherController.php | 7 +++++-- resources/js/Customer/Trx/Index.jsx | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 882e404..48398a1 100644 --- a/README.md +++ b/README.md @@ -38,4 +38,6 @@ npm run build ```bash rsync -arP -e 'ssh -p 224' --exclude=node_modules --exclude=.git --exclude=.env --exclude=storage --exclude=public/hot . arm@ajikamaludin.id:/home/arm/projects/voucher + +rsync -arP -e 'ssh -p 224' --exclude=node_modules --exclude=database/database.sqlite --exclude=.git --exclude=.env --exclude=storage --exclude=public/hot . arm@ajikamaludin.id:/home/arm/projects/voucher ``` diff --git a/app/Http/Controllers/Customer/AuthController.php b/app/Http/Controllers/Customer/AuthController.php index 9f96e03..bab86ec 100644 --- a/app/Http/Controllers/Customer/AuthController.php +++ b/app/Http/Controllers/Customer/AuthController.php @@ -27,6 +27,8 @@ class AuthController extends Controller public function login() { + session()->remove('carts'); + return inertia('Auth/Login'); } @@ -85,6 +87,8 @@ class AuthController extends Controller public function register() { + session()->remove('carts'); + return inertia('Auth/Register'); } @@ -139,7 +143,7 @@ class AuthController extends Controller public function destroy() { session()->remove('carts'); - + Auth::logout(); return redirect()->route('customer.login') diff --git a/app/Http/Controllers/VoucherController.php b/app/Http/Controllers/VoucherController.php index 641bad9..90d3142 100644 --- a/app/Http/Controllers/VoucherController.php +++ b/app/Http/Controllers/VoucherController.php @@ -123,13 +123,16 @@ class VoucherController extends Controller DB::beginTransaction(); + $voucher->update([ + 'username' => $request->username, + 'password' => $request->password, + ]); + $vouchers = Voucher::where('batch_id', $voucher->batch_id); $vouchers->update([ 'name' => $request->name, 'description' => $request->description, 'location_id' => $request->location_id, - 'username' => $request->username, - 'password' => $request->password, 'discount' => $request->discount, 'display_price' => $request->display_price, 'price_coin' => $request->price_coin, diff --git a/resources/js/Customer/Trx/Index.jsx b/resources/js/Customer/Trx/Index.jsx index 5bb6149..11808b6 100644 --- a/resources/js/Customer/Trx/Index.jsx +++ b/resources/js/Customer/Trx/Index.jsx @@ -7,7 +7,7 @@ const EmptyHere = () => {
Transaksi kosong
- Yuk, checkout kerangjang mu sekarang! + Yuk, checkout keranjang mu sekarang!
)