(orderDetail)
| 140 | |
| 141 | |
| 142 | function preparingOrder(orderDetail){ |
| 143 | console.log(`Your food preparation started of ${orderDetail.food}`); |
| 144 | |
| 145 | return new Promise((resolve,reject)=>{ |
| 146 | |
| 147 | setTimeout(()=>{ |
| 148 | |
| 149 | if(Math.random()>0.05){ |
| 150 | console.log("Your order is now prepared"); |
| 151 | orderDetail.token = 123; |
| 152 | resolve(orderDetail); |
| 153 | } |
| 154 | else{ |
| 155 | reject("Food item is not persent at restaurant"); |
| 156 | } |
| 157 | |
| 158 | },3000); |
| 159 | }) |
| 160 | |
| 161 | } |
| 162 | |
| 163 | |
| 164 | function pickupOrder(orderDetail){ |