-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sussessfully changed to tanstack-react-query
- Loading branch information
Showing
25 changed files
with
437 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
NEXT_PUBLIC_ENV=development | ||
NEXT_PUBLIC_SERVER_URL=http://localhost:8000 | ||
NEXT_PUBLIC_API_URL=http://localhost:8000/api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,46 @@ | ||
"use client"; | ||
import OtpVerificationSection from "@/components/forms/OtpForms"; | ||
import OtpVerificationSection from "@/components/common/forms/OtpForms"; | ||
import Image from "next/image"; | ||
import React, { FormEvent, useState } from "react"; | ||
import { useValidateOtpPatient } from "@/lib/hooks/usePatinet"; | ||
import { useToast } from "@/components/ui/use-toast"; | ||
import { useRouter } from "next/navigation"; | ||
import { Button } from "@/components/ui/button"; | ||
import Link from "next/link"; | ||
|
||
const OtpVerificationPage = () => { | ||
const [otp, setOtp] = useState(""); | ||
const [isLoading, setLoading] = useState(false); | ||
const [otp, setOtp] = useState<string>(""); | ||
const { mutate: validateOtp, isPending } = useValidateOtpPatient(); | ||
const { toast } = useToast(); | ||
const navigate = useRouter(); | ||
|
||
const handleVerify = async (e: FormEvent) => { | ||
e.preventDefault(); | ||
try { | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
validateOtp( | ||
{ email: "[email protected]", otp: parseInt(otp) }, | ||
{ | ||
onSuccess: (data) => { | ||
toast({ | ||
title: "Otp Verification Success ✅", | ||
description: "Authentication Completed!. let's book your first appointment", | ||
variant: "default", | ||
action: ( | ||
<Button variant={"outline"}> | ||
<Link href={"/new-appointment"}>Book Now</Link> | ||
</Button> | ||
), | ||
}); | ||
console.log(data); | ||
}, | ||
onError: (error) => { | ||
toast({ | ||
title: "Otp Verification Failed ❌", | ||
description: error.response?.data.message, | ||
variant: "destructive", | ||
}); | ||
}, | ||
} | ||
); | ||
}; | ||
|
||
const handleResend = async () => {}; | ||
|
@@ -32,7 +61,7 @@ const OtpVerificationPage = () => { | |
otp={otp} | ||
setOtp={setOtp} | ||
handleVerify={handleVerify} | ||
isLoading={isLoading} | ||
isLoading={isPending} | ||
timer={30} | ||
/> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
284f847
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
avm-care – ./
avm-care-git-main-sinans-projects-8d312afe.vercel.app
avm-care.vercel.app
avm-care-sinans-projects-8d312afe.vercel.app