Skip to content

Commit

Permalink
Merge branch 'feat/request-hooks' of https://github.com/UoaWDCC/auis-…
Browse files Browse the repository at this point in the history
…portal into feat/request-hooks
  • Loading branch information
gmat224 committed Dec 22, 2024
2 parents c7af7ac + 8e51aff commit 5b8dd39
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 22 deletions.
2 changes: 1 addition & 1 deletion web/src/hooks/api/useAttendanceUpdateMutation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMutation } from "@tanstack/react-query";
import { postAttendanceUpdate} from "../../api/apiRequests";
import { postAttendanceUpdate } from "../../api/apiRequests";
import { AttendanceReturn } from "../../types/types";

export const useUpdateAttendance = () => {
Expand Down
46 changes: 26 additions & 20 deletions web/src/screens/CheckoutScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let bodyData: { priceId: string; userTicketId: number };
export default function CheckoutScreen() {
const { data, mutateAsync, status } = useEventOrMembershipCheckoutSecret();
const location = useLocation();
const navigate = useNavigate()
const navigate = useNavigate();
// ensure data required for checkout is here

try {
Expand Down Expand Up @@ -59,26 +59,32 @@ export default function CheckoutScreen() {
return <LoadingSpinner />;
}

if (status === "error" || data?.clientSecret=== undefined){
return (<div className="max-w-screen from-AUIS-dark-teal to-AUIS-teal min-h-screen bg-gradient-to-b">
<div className="flex flex-col items-center text-center">
<h1 className="my-12 text-5xl font-bold text-white">Checkout</h1>
if (status === "error" || data?.clientSecret === undefined) {
return (
<div className="max-w-screen from-AUIS-dark-teal to-AUIS-teal min-h-screen bg-gradient-to-b">
<div className="flex flex-col items-center text-center">
<h1 className="my-12 text-5xl font-bold text-white">Checkout</h1>
</div>
<div className="item flex justify-center">
<p className="pt-16 text-center text-xl text-white">
Sorry an error occurred, please try again
<br />
This could be caused by ticket being sold out, or some other error
</p>
</div>
<div className="flex justify-center">
<button
type="button"
className="bg-primary-orange mt-24 rounded-2xl px-10 py-3 text-3xl font-bold text-white transition-all hover:scale-110"
onClick={() => {
navigate("/");
}}
>
Return to Home screen
</button>
</div>
</div>
<div className="item flex justify-center">
<p className="text-xl pt-16 text-white text-center">Sorry an error occurred, please try again<br/>This could be caused by ticket being sold out, or some other error</p>

</div><div className="flex justify-center">
<button
type="button"
className="bg-primary-orange mt-24 rounded-2xl px-10 py-3 text-3xl font-bold text-white transition-all hover:scale-110"
onClick={() => {
navigate("/");
}}
>
Return to Home screen
</button>
</div>
</div>)
);
}

if (status === "success") {
Expand Down
1 change: 0 additions & 1 deletion web/src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ export interface EventOrMembershipReturn {
clientSecret: string;
}


export interface stripeSessionStatus {
customer_email: string;
status: string;
Expand Down

0 comments on commit 5b8dd39

Please sign in to comment.