From 6b7ff948018c4795097612d78456441477239a6c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 21 Dec 2024 07:17:54 +0000 Subject: [PATCH] Format code with Prettier --- api/controller/userController.ts | 2 +- api/gateway/userGateway.ts | 2 +- web/src/api/apiRequests.ts | 34 ++++++++-------- .../components/forms/CheckoutInformation.tsx | 39 +++++++++++-------- .../forms/CheckoutInformationForm.tsx | 3 +- .../PurchaseMembershipCard.tsx | 2 +- web/src/hooks/api/useSessionStatus.ts | 2 +- web/src/hooks/api/useUpdateUserTicketInfo.ts | 31 +++++---------- web/src/screens/AboutUsScreen.tsx | 4 +- web/src/screens/AttendanceScreen.tsx | 6 +-- web/src/types/types.ts | 2 +- 11 files changed, 61 insertions(+), 66 deletions(-) diff --git a/api/controller/userController.ts b/api/controller/userController.ts index af1a115..2832729 100644 --- a/api/controller/userController.ts +++ b/api/controller/userController.ts @@ -13,7 +13,7 @@ import { insertUserBySuperToken } from "../gateway/userGateway"; export const updateUserTicketInfo = asyncHandler( async (req: Request, res: Response) => { // console.log(process.env.DOMAIN_DB); - console.log(req.body) + console.log(req.body); try { const { name, email, phoneNumber, ticketId, answers } = req.body; diff --git a/api/gateway/userGateway.ts b/api/gateway/userGateway.ts index 7de2d4b..d85e4c1 100644 --- a/api/gateway/userGateway.ts +++ b/api/gateway/userGateway.ts @@ -183,7 +183,7 @@ export async function insertUserTicket(data: { "insertUserTicket: userTicketsPeopleIdLink: ticketId: ", data.ticketId ); - + // let userTicketsPeopleIdLink = await db // .insert(userTicketsPeopleIdLinks) // .values({ diff --git a/web/src/api/apiRequests.ts b/web/src/api/apiRequests.ts index 81bf7fa..0fb3b06 100644 --- a/web/src/api/apiRequests.ts +++ b/web/src/api/apiRequests.ts @@ -21,8 +21,8 @@ export const getUserMetaData = async (): Promise => { "Content-Type": "application/json", }, }); - console.log("getUserMetatdat") - console.log(response) + console.log("getUserMetatdat"); + console.log(response); return response; }; @@ -35,33 +35,31 @@ export const updateUserInfo = async (data: object): Promise => { data: { data }, }); - console.log("update user info") - console.log(response) + console.log("update user info"); + console.log(response); return response; }; export const updateUserTicketInfo = async ( - - ticketId: number, - name: string, - email: string, - phoneNumber: string, - answers: AnswerList[] - + ticketId: number, + name: string, + email: string, + phoneNumber: string, + answers: AnswerList[] ): Promise => { const data = { ticketId, name, email, phoneNumber, - answers - } + answers, + }; const response = await apiClient.post("/api/user/user-ticket-info", data, { headers: { "Content-Type": "application/json", }, - }) - console.log("update user ticket info worked") + }); + console.log("update user ticket info worked"); return response.data; }; @@ -115,8 +113,8 @@ export const getSessionStatus = async ( } ); - console.log("get session id") - console.log(response) + console.log("get session id"); + console.log(response); return response.data; }; @@ -134,7 +132,7 @@ export const fetchEventOrMembershipCheckoutSecret = async (payload: { headers: { "Content-Type": "application/json" }, } ); - console.log("FETCH EVENT OR MEBERSHcK CHECKOUT SECRETYE") + console.log("FETCH EVENT OR MEBERSHcK CHECKOUT SECRETYE"); return response.data.clientSecret; }; diff --git a/web/src/components/forms/CheckoutInformation.tsx b/web/src/components/forms/CheckoutInformation.tsx index 8df8156..61f9e74 100644 --- a/web/src/components/forms/CheckoutInformation.tsx +++ b/web/src/components/forms/CheckoutInformation.tsx @@ -1,4 +1,8 @@ -import { AnswerList, QuestionAnswer, TicketAndQuestion } from "../../types/types"; +import { + AnswerList, + QuestionAnswer, + TicketAndQuestion, +} from "../../types/types"; import { useEffect, useState } from "react"; import { useQuery } from "@apollo/client"; import { getTicketQuestions } from "../../graphql/queries"; @@ -57,7 +61,6 @@ export default function CheckoutInformation({ window.scrollTo(0, 0); }, []); - // States const [ticketAndQuestions, setTicketAndQuestions] = useState(); @@ -67,23 +70,25 @@ export default function CheckoutInformation({ const [submitError, setSubmitError] = useState(false); const [submitLoading, setSubmitLoading] = useState(false); - - const { data : updateUserTicketInfoData, mutateAsync, status } = useUpdateUserTicketInfo(); + const { + data: updateUserTicketInfoData, + mutateAsync, + status, + } = useUpdateUserTicketInfo(); // Update status text as it changes useEffect(() => { if (status === "success") { navigateToPaymentScreen( updateUserTicketInfoData.updateUserInfoOrNewUser.userTicketId - ) + ); } - + if (status == "pending") { setSubmitLoading(true); - }else { - setSubmitLoading(false) + } else { + setSubmitLoading(false); } - if (status == "error") { setSubmitError(true); } @@ -103,16 +108,16 @@ export default function CheckoutInformation({ const answerList = answers.map(({ question, indexId, ...rest }) => { return rest; }); - + // Mutation hook - + mutateAsync({ - ticketId: ticketId, - name: name, - email: email, - phoneNumber: phoneNumber, - answers: answerList, - }) + ticketId: ticketId, + name: name, + email: email, + phoneNumber: phoneNumber, + answers: answerList, + }); // const temp = await mutateAsync(data) // call post request // onSubmit({ diff --git a/web/src/components/forms/CheckoutInformationForm.tsx b/web/src/components/forms/CheckoutInformationForm.tsx index d546ba7..b6137a1 100644 --- a/web/src/components/forms/CheckoutInformationForm.tsx +++ b/web/src/components/forms/CheckoutInformationForm.tsx @@ -187,7 +187,8 @@ export default function CheckoutInformationForm({
If this is a double ticket, both ticket holders must be members.
- If this is a Member ticket, make sure you haven't already purchased a Member ticket. + If this is a Member ticket, make sure you haven't already purchased + a Member ticket.

) : ( <> diff --git a/web/src/components/membership-page/PurchaseMembershipCard.tsx b/web/src/components/membership-page/PurchaseMembershipCard.tsx index cb95f6e..f11fc18 100644 --- a/web/src/components/membership-page/PurchaseMembershipCard.tsx +++ b/web/src/components/membership-page/PurchaseMembershipCard.tsx @@ -49,7 +49,7 @@ export default function PurchaseMembershipCard({ } return ( -
+
{ +export const useSessionStatus = (sessionId: string) => { return useQuery({ queryKey: ["attendanceList"], queryFn: () => getSessionStatus(sessionId), diff --git a/web/src/hooks/api/useUpdateUserTicketInfo.ts b/web/src/hooks/api/useUpdateUserTicketInfo.ts index 5743a27..9ba020a 100644 --- a/web/src/hooks/api/useUpdateUserTicketInfo.ts +++ b/web/src/hooks/api/useUpdateUserTicketInfo.ts @@ -1,8 +1,8 @@ import { useMutation } from "@tanstack/react-query"; import { updateUserTicketInfo } from "../../api/apiRequests"; import { - AnswerList, - QuestionAnswer, + AnswerList, + QuestionAnswer, SubmitUpdateUserInfoOrNewUser, UpdateUserInfoOrNewUser, } from "../../types/types"; @@ -12,25 +12,14 @@ export const useUpdateUserTicketInfo = () => { UpdateUserInfoOrNewUser, Error, { - ticketId: number; - name: string; - email: string; - phoneNumber: string; - answers: AnswerList[]; - } + ticketId: number; + name: string; + email: string; + phoneNumber: string; + answers: AnswerList[]; + } >({ - mutationFn: ({ - ticketId, - name, - email, - phoneNumber, - answers - }) => updateUserTicketInfo( - ticketId, - name, - email, - phoneNumber, - answers - ), + mutationFn: ({ ticketId, name, email, phoneNumber, answers }) => + updateUserTicketInfo(ticketId, name, email, phoneNumber, answers), }); }; diff --git a/web/src/screens/AboutUsScreen.tsx b/web/src/screens/AboutUsScreen.tsx index 0a24eb3..2910a22 100644 --- a/web/src/screens/AboutUsScreen.tsx +++ b/web/src/screens/AboutUsScreen.tsx @@ -159,7 +159,9 @@ export default function AboutUsScreen({ navbar }: { navbar: JSX.Element }) {

Our Values

{errorValues ? ( -
There are no values to display
+
+ There are no values to display +
) : (
{values.map((value) => ( diff --git a/web/src/screens/AttendanceScreen.tsx b/web/src/screens/AttendanceScreen.tsx index 605d94d..8f72837 100644 --- a/web/src/screens/AttendanceScreen.tsx +++ b/web/src/screens/AttendanceScreen.tsx @@ -138,7 +138,7 @@ export default function AttendanceScreen({ navbar }: { navbar: JSX.Element }) { if (loadingAttendanceList) { return ; } - + return (
{navbar} @@ -159,7 +159,7 @@ export default function AttendanceScreen({ navbar }: { navbar: JSX.Element }) { onScan={(result) => onQRcodeScanned(result)} allowMultiple={true} scanDelay={1000} - constraints={{deviceId: cameraId}} + constraints={{ deviceId: cameraId }} onError={() => setCameraError(true)} styles={{}} /> @@ -229,7 +229,7 @@ export default function AttendanceScreen({ navbar }: { navbar: JSX.Element }) { Attendance: {totalCheckedIn} {" / "} {totalAttendees}

-
+

Select the camera you wish to use

diff --git a/web/src/types/types.ts b/web/src/types/types.ts index 705dec8..e1deab5 100644 --- a/web/src/types/types.ts +++ b/web/src/types/types.ts @@ -157,4 +157,4 @@ export interface SubmitUpdateUserInfoOrNewUser { export interface AnswerList { questionId: number; answer: string; -} \ No newline at end of file +}