From 9814b1974a08a94730ce98b2c965636a8f52228b Mon Sep 17 00:00:00 2001 From: vinit717 Date: Mon, 16 Sep 2024 13:05:17 +0530 Subject: [PATCH 1/3] chore: fix met tag for twitter --- src/components/Layout/index.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/Layout/index.tsx b/src/components/Layout/index.tsx index 1f759cc..34a1e84 100644 --- a/src/components/Layout/index.tsx +++ b/src/components/Layout/index.tsx @@ -34,6 +34,14 @@ const Layout: FC = ({ title, children, classNames }) => { + + + + + From 947dc02d044947f2d34501610f58ade01a55c126 Mon Sep 17 00:00:00 2001 From: vinit717 Date: Tue, 17 Sep 2024 02:11:53 +0530 Subject: [PATCH 2/3] chore: fix meta image resolution --- src/components/Layout/index.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/Layout/index.tsx b/src/components/Layout/index.tsx index 34a1e84..1de82ae 100644 --- a/src/components/Layout/index.tsx +++ b/src/components/Layout/index.tsx @@ -42,6 +42,8 @@ const Layout: FC = ({ title, children, classNames }) => { /> + + From 1328e3308c8d980d8966e03b507776cb8c0be42b Mon Sep 17 00:00:00 2001 From: vinit717 Date: Tue, 17 Sep 2024 02:23:56 +0530 Subject: [PATCH 3/3] chore: remove unwanted file --- src/services/api.tsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/services/api.tsx b/src/services/api.tsx index 282cb6f..87f13b9 100644 --- a/src/services/api.tsx +++ b/src/services/api.tsx @@ -10,22 +10,18 @@ interface ShortenUrlRequest { CreatedBy: string; UserId: number; } - interface ShortenUrlResponse { shortUrl: string; } - interface MutationParams { originalUrl: string; userData: User; } - export interface ApiError { message: string; statusCode: number; details?: string; } - const useAuthenticatedQuery = () => { return useQuery({ queryKey: ['useAuthenticatedQuery'], @@ -61,24 +57,24 @@ const useGetUrlsQuery = ({ enabled = true }: { enabled?: boolean }) => { queryFn: getUrlsApi, }); }; - interface useShortenUrlMutationArgs { onSuccess?: (data: ShortenUrlResponse) => void; onError?: (error: AxiosError) => void; } - const useShortenUrlMutation = ({ onSuccess, onError }: useShortenUrlMutationArgs = {}): UseMutationResult< ShortenUrlResponse, AxiosError, MutationParams > => { return useMutation( - async ({ originalUrl }: MutationParams) => { + async ({ originalUrl, userData }: MutationParams) => { const response = await axios.post( `${TINY_API_URL}/tinyurl`, { OriginalUrl: originalUrl, Comment: '', + CreatedBy: userData?.data?.userName, + UserId: userData?.data?.id, } as ShortenUrlRequest, { withCredentials: true, @@ -93,9 +89,10 @@ const useShortenUrlMutation = ({ onSuccess, onError }: useShortenUrlMutationArgs } ); }; -const deleteUrlApi = async ({ id }: { id: number; userId: number }) => { +const deleteUrlApi = async ({ id, userId }: { id: number; userId: number }) => { const { data } = await axios.delete(`${TINY_API_URL}/urls/${id}`, { withCredentials: true, + data: { user_id: userId }, }); return data; };