Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed order details data #513

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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="RatingLowtoHigh">Rating -- Low to High</option>
<option value="RatingHightoLow">Rating -- High to Low</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