Skip to content

Commit

Permalink
Merge branch '349-place-order' of https://github.com/olasunkanmi-SE/r…
Browse files Browse the repository at this point in the history
…estaurant into 349-place-order
  • Loading branch information
Olasunkanmi Oyinlola authored and Olasunkanmi Oyinlola committed Jan 19, 2024
2 parents adf63c5 + b535490 commit 082fae9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions backend/src/restaurant/restaurant.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { RestaurantData } from './../infrastructure/data_access/repositories/sch
import { LocationMapper } from './../location/location.mapper';
import { SingleClientMapper } from './../singleclient/singleclient.mapper';
import { Restaurant } from './restaurant';

@Injectable()
export class RestaurantMapper implements IMapper<Restaurant, RestaurantData> {
constructor(
Expand Down
1 change: 1 addition & 0 deletions frontend/src/apis/orderApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const OrderApi = () => {
return totalSelectedItemsPrice;
};


const cartItemsMapper = (orderSummary: OrderSummary[]): IcartItems[] => {
const menus = orderSummary.flatMap((summary) => summary.menus);
const cartItems = menus.map((menu) => {
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/components/Cart/ShoppinCartDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,14 @@ export const ShoppingCartDetails = () => {
>
PLACE ORDER RM{handleCalculateTotalOrder() + calculateServiceCharge(calculateTotalOrderAmount())}
</Button>
<div>
{handleCreateOrder.isLoading ? (
"Creating Order..."
) : (
<>{handleCreateOrder.isError ? <div>An error occurred: {handleCreateOrder.error.message}</div> : null}</>
)}
{handleCreateOrder.isSuccess ? <div>Order processed successfully</div> : null}
</div>
</div>
<div>
{showClearCartModal && (
Expand Down

0 comments on commit 082fae9

Please sign in to comment.