buy service call back url
This commit is contained in:
@@ -21,7 +21,6 @@ export async function generateMetadata(
|
|||||||
|
|
||||||
await queryClient.prefetchQuery(getProductBySlugQueryOptions(id))
|
await queryClient.prefetchQuery(getProductBySlugQueryOptions(id))
|
||||||
const service = queryClient.getQueryData(getProductBySlugQueryOptions(id).queryKey) as ServiceDetailResponse
|
const service = queryClient.getQueryData(getProductBySlugQueryOptions(id).queryKey) as ServiceDetailResponse
|
||||||
console.log('service', service);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: 'محصولات داناک' + ' | ' + service.data.danakService.name,
|
title: 'محصولات داناک' + ' | ' + service.data.danakService.name,
|
||||||
|
|||||||
@@ -9,12 +9,14 @@ import { DanakService } from '../types/ProductTypes'
|
|||||||
import RadioGroup from '@/components/RadioGroup'
|
import RadioGroup from '@/components/RadioGroup'
|
||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
import { CONSOLE_URL } from '@/config/const'
|
import { CONSOLE_URL } from '@/config/const'
|
||||||
|
import { useSharedStore } from '@/shared/store/sharedStore'
|
||||||
type Props = {
|
type Props = {
|
||||||
data: DanakService,
|
data: DanakService,
|
||||||
}
|
}
|
||||||
|
|
||||||
const ServiceHeader: FC<Props> = (props: Props) => {
|
const ServiceHeader: FC<Props> = (props: Props) => {
|
||||||
|
|
||||||
|
const { isLogin } = useSharedStore()
|
||||||
const { data } = props
|
const { data } = props
|
||||||
const [planSelected, setPlanSelected] = useState<string>(data?.subscriptionPlans[0]?.id)
|
const [planSelected, setPlanSelected] = useState<string>(data?.subscriptionPlans[0]?.id)
|
||||||
const [price, setPrice] = useState<number>(data?.subscriptionPlans[0]?.price)
|
const [price, setPrice] = useState<number>(data?.subscriptionPlans[0]?.price)
|
||||||
@@ -86,7 +88,7 @@ const ServiceHeader: FC<Props> = (props: Props) => {
|
|||||||
</div>
|
</div>
|
||||||
<span>تومان</span>
|
<span>تومان</span>
|
||||||
</div>
|
</div>
|
||||||
<Link target='_blank' href={`${CONSOLE_URL}/other-service/buy/${data?.id}/${planSelected}`}>
|
<Link target='_blank' href={`${isLogin ? CONSOLE_URL + `/other-service/buy/${data?.id}/${planSelected}` : CONSOLE_URL + '/auth/login'}?redirect=${CONSOLE_URL}/other-service/buy/${data?.id}/${planSelected}`}>
|
||||||
<Button
|
<Button
|
||||||
// onClick={handleBuy}
|
// onClick={handleBuy}
|
||||||
// isLoading={buyService.isPending}
|
// isLoading={buyService.isPending}
|
||||||
|
|||||||
Reference in New Issue
Block a user