fix wrong status for user after book supplier

This commit is contained in:
Jack Goh
2018-06-28 12:13:09 +08:00
parent ee7fe28f74
commit d054703170
2 changed files with 8 additions and 1 deletions
@@ -425,6 +425,13 @@ class BookingController extends Controller
public function confirmPurchaseOrder($id){
$booking = Booking::where('user_id',Auth::user()->id)->where('id',$id)->first();
$purchase_order = $booking->purchaseOrder()->first();
if(!$purchase_order){
return response()->json(["message"=> "Please upload your purchase order"],400);
}
$booking->status = 6;
$booking->save();
return response()->json(['message'=>'Success'],200);