Skip to content

Commit

Permalink
fix: fixed order details data
Browse files Browse the repository at this point in the history
  • Loading branch information
kundan singh authored and kundan singh committed Apr 5, 2024
1 parent 260b4f9 commit d87403a
Show file tree
Hide file tree
Showing 4 changed files with 366 additions and 387 deletions.
6 changes: 3 additions & 3 deletions apps/retail/components/filter/Filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ const Filter = ({ handleApplyFilter, handleResetFilter }) => {
paddingBottom={'2px'}
>
<option value="">Rating</option>
<option value="2+">2+</option>
<option value="4+">4+</option>
<option value="lessthan4+">Less than 4+</option>
<option value="morethan4+">More than 4+</option>
</Select>
<FormLabel
className="dropDown_label"
fontSize="15px"
>
Sort By Rating
Filter By Rating
</FormLabel>
</FormControl>
</Box>
Expand Down
91 changes: 46 additions & 45 deletions apps/retail/pages/orderConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useSelector, useDispatch } from 'react-redux'
import { useLanguage } from '../hooks/useLanguage'
import { ConfirmationPage } from '@beckn-ui/becknified-components'
import { InitResponseModel } from '../types/init.types'
import { CheckoutRootState,checkoutActions } from '@store/checkout-slice'
import { CheckoutRootState, checkoutActions } from '@store/checkout-slice'
import { orderActions } from '@store/order-slice'
import { useConfirmMutation } from '@services/confirm'
import { getPayloadForConfirm, getPayloadForOrderHistoryPost } from '@utils/confirm-utils'
Expand All @@ -23,7 +23,6 @@ const OrderConfirmation = () => {
const [confirm, { isLoading, data }] = useConfirmMutation()
const dispatch = useDispatch()


const initResponse = useSelector((state: CheckoutRootState) => state.checkout.initResponse)
const confirmResponse = useSelector((state: CheckoutRootState) => state.checkout.confirmResponse)
const apiUrl = process.env.NEXT_PUBLIC_API_URL
Expand Down Expand Up @@ -72,51 +71,53 @@ const OrderConfirmation = () => {
}

return (
<ConfirmationPage
schema={{
iconSrc: orderConfirmmark,
content: t.orderPlaced,
contentMessage: t.orderSuccesfully,
successOrderMessage:'ORDER SUCCESFULL',
gratefulMessage:"Thank you for your order!",
orderIdMessage:`Order number is: ${confirmResponse && confirmResponse.length > 0 && confirmResponse[0].message.orderId.slice(0, 8)}...`,
trackOrderMessage:`You can track your order in "My Order" section`,

buttons: [
{
text: 'View Details',
handleClick: () => {
const orderId = confirmResponse[0].message.orderId
const bppId = confirmResponse[0].context.bppId
const bppUri = confirmResponse[0].context.bppUri
<Box textAlign={'center'}>
<ConfirmationPage
schema={{
iconSrc: orderConfirmmark,
content: t.orderPlaced,
contentMessage: t.orderSuccesfully,
successOrderMessage: 'ORDER SUCCESFULL',
gratefulMessage: 'Thank you for your order!',
orderIdMessage: `Order number is: ${confirmResponse && confirmResponse.length > 0 && confirmResponse[0].message.orderId.slice(0, 8)}...`,
trackOrderMessage: `You can track your order in "My Order" section`,

dispatch(orderActions.addSelectedOrder({ orderDetails: { orderId, bppId, bppUri } }))
const orderObjectForStatusCall = {
bppId: bppId,
bppUri: bppUri,
orderId: orderId
}
localStorage.setItem('selectedOrder', JSON.stringify(orderObjectForStatusCall))
dispatch(checkoutActions.clearState())
router.push('/orderDetails')
},
disabled: false,
variant: 'solid',
colorScheme: 'primary'
},
{
text: 'Go Back Home',
handleClick: () => {
router.push('/')
dispatch(checkoutActions.clearState())
buttons: [
{
text: 'View Details',
handleClick: () => {
const orderId = confirmResponse[0].message.orderId
const bppId = confirmResponse[0].context.bppId
const bppUri = confirmResponse[0].context.bppUri

dispatch(orderActions.addSelectedOrder({ orderDetails: { orderId, bppId, bppUri } }))
const orderObjectForStatusCall = {
bppId: bppId,
bppUri: bppUri,
orderId: orderId
}
localStorage.setItem('selectedOrder', JSON.stringify(orderObjectForStatusCall))
dispatch(checkoutActions.clearState())
router.push('/orderDetails')
},
disabled: false,
variant: 'solid',
colorScheme: 'primary'
},
disabled: false,
variant: 'outline',
colorScheme: 'primary'
}
]
}}
/>
{
text: 'Go Back Home',
handleClick: () => {
router.push('/')
dispatch(checkoutActions.clearState())
},
disabled: false,
variant: 'outline',
colorScheme: 'primary'
}
]
}}
/>
</Box>
)
}

Expand Down
Loading

0 comments on commit d87403a

Please sign in to comment.