Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { AxiosError } from "axios";
import { axiosInstance } from "@/utils/axiosInstance";
import { useMutation } from "@tanstack/react-query";

export interface ๊ฒŒ์‹œ๊ธ€ ์‚ญ์ œRequest {
// TODO: Define request type
}

const ๊ฒŒ์‹œ๊ธ€ ์‚ญ์ œ = async (): Promise<๊ฒŒ์‹œ๊ธ€ ์‚ญ์ œResponse> => {
const res = await axiosInstance.delete<๊ฒŒ์‹œ๊ธ€ ์‚ญ์ œResponse>(
`{`
);
return res.data;
};

const use๊ฒŒ์‹œ๊ธ€ ์‚ญ์ œ = () => {
return useMutation<๊ฒŒ์‹œ๊ธ€ ์‚ญ์ œResponse, AxiosError, ๊ฒŒ์‹œ๊ธ€ ์‚ญ์ œRequest>({
mutationFn: (data) => ๊ฒŒ์‹œ๊ธ€ ์‚ญ์ œ({ data }),
});
};

export default use๊ฒŒ์‹œ๊ธ€ ์‚ญ์ œ;
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { AxiosError } from "axios";
import { axiosInstance } from "@/utils/axiosInstance";
import { useMutation } from "@tanstack/react-query";

export interface ๊ฒŒ์‹œ๊ธ€ ์ข‹์•„์š” ์‚ญ์ œRequest {
// TODO: Define request type
}

const ๊ฒŒ์‹œ๊ธ€ ์ข‹์•„์š” ์‚ญ์ œ = async (): Promise<๊ฒŒ์‹œ๊ธ€ ์ข‹์•„์š” ์‚ญ์ œResponse> => {
const res = await axiosInstance.delete<๊ฒŒ์‹œ๊ธ€ ์ข‹์•„์š” ์‚ญ์ œResponse>(
`{`
);
return res.data;
};

const use๊ฒŒ์‹œ๊ธ€ ์ข‹์•„์š” ์‚ญ์ œ = () => {
return useMutation<๊ฒŒ์‹œ๊ธ€ ์ข‹์•„์š” ์‚ญ์ œResponse, AxiosError, ๊ฒŒ์‹œ๊ธ€ ์ข‹์•„์š” ์‚ญ์ œRequest>({
mutationFn: (data) => ๊ฒŒ์‹œ๊ธ€ ์ข‹์•„์š” ์‚ญ์ œ({ data }),
});
};

export default use๊ฒŒ์‹œ๊ธ€ ์ข‹์•„์š” ์‚ญ์ œ;
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { AxiosError } from "axios";
import { axiosInstance } from "@/utils/axiosInstance";
import { useMutation } from "@tanstack/react-query";

export interface ๋Œ“๊ธ€ ์‚ญ์ œRequest {
// TODO: Define request type
}

const ๋Œ“๊ธ€ ์‚ญ์ œ = async (): Promise<๋Œ“๊ธ€ ์‚ญ์ œResponse> => {
const res = await axiosInstance.delete<๋Œ“๊ธ€ ์‚ญ์ œResponse>(
`{`
);
return res.data;
};

const use๋Œ“๊ธ€ ์‚ญ์ œ = () => {
return useMutation<๋Œ“๊ธ€ ์‚ญ์ œResponse, AxiosError, ๋Œ“๊ธ€ ์‚ญ์ œRequest>({
mutationFn: (data) => ๋Œ“๊ธ€ ์‚ญ์ œ({ data }),
});
};

export default use๋Œ“๊ธ€ ์‚ญ์ œ;
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { AxiosError } from "axios";
import { axiosInstance } from "@/utils/axiosInstance";
import { useMutation } from "@tanstack/react-query";

export interface ์†Œ์‹์ง€ ์‚ญ์ œRequest {
// TODO: Define request type
}

const ์†Œ์‹์ง€ ์‚ญ์ œ = async (): Promise<์†Œ์‹์ง€ ์‚ญ์ œResponse> => {
const res = await axiosInstance.delete<์†Œ์‹์ง€ ์‚ญ์ œResponse>(
`{`
);
return res.data;
};

const use์†Œ์‹์ง€ ์‚ญ์ œ = () => {
return useMutation<์†Œ์‹์ง€ ์‚ญ์ œResponse, AxiosError, ์†Œ์‹์ง€ ์‚ญ์ œRequest>({
mutationFn: (data) => ์†Œ์‹์ง€ ์‚ญ์ œ({ data }),
});
};

export default use์†Œ์‹์ง€ ์‚ญ์ œ;
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { AxiosError } from "axios";
import { axiosInstance } from "@/utils/axiosInstance";
import { useMutation } from "@tanstack/react-query";

export interface ์†Œ์‹์ง€ ์ข‹์•„์š” ์‚ญ์ œRequest {
// TODO: Define request type
}

const ์†Œ์‹์ง€ ์ข‹์•„์š” ์‚ญ์ œ = async (): Promise<์†Œ์‹์ง€ ์ข‹์•„์š” ์‚ญ์ œResponse> => {
const res = await axiosInstance.delete<์†Œ์‹์ง€ ์ข‹์•„์š” ์‚ญ์ œResponse>(
`{`
);
return res.data;
};

const use์†Œ์‹์ง€ ์ข‹์•„์š” ์‚ญ์ œ = () => {
return useMutation<์†Œ์‹์ง€ ์ข‹์•„์š” ์‚ญ์ œResponse, AxiosError, ์†Œ์‹์ง€ ์ข‹์•„์š” ์‚ญ์ œRequest>({
mutationFn: (data) => ์†Œ์‹์ง€ ์ข‹์•„์š” ์‚ญ์ œ({ data }),
});
};

export default use์†Œ์‹์ง€ ์ข‹์•„์š” ์‚ญ์ œ;
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { AxiosError } from "axios";
import { axiosInstance } from "@/utils/axiosInstance";
import { useMutation } from "@tanstack/react-query";

export interface ์œ„์‹œ ํ•™๊ต ์‚ญ์ œRequest {
// TODO: Define request type
}

const ์œ„์‹œ ํ•™๊ต ์‚ญ์ œ = async (): Promise<์œ„์‹œ ํ•™๊ต ์‚ญ์ œResponse> => {
const res = await axiosInstance.delete<์œ„์‹œ ํ•™๊ต ์‚ญ์ œResponse>(
`{`
);
return res.data;
};

const use์œ„์‹œ ํ•™๊ต ์‚ญ์ œ = () => {
return useMutation<์œ„์‹œ ํ•™๊ต ์‚ญ์ œResponse, AxiosError, ์œ„์‹œ ํ•™๊ต ์‚ญ์ œRequest>({
mutationFn: (data) => ์œ„์‹œ ํ•™๊ต ์‚ญ์ œ({ data }),
});
};

export default use์œ„์‹œ ํ•™๊ต ์‚ญ์ œ;
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { AxiosError } from "axios";
import { axiosInstance } from "@/utils/axiosInstance";
import { useMutation } from "@tanstack/react-query";

export interface ์œ ์ € ์ฐจ๋‹จ ์ทจ์†ŒRequest {
// TODO: Define request type
}

const ์œ ์ € ์ฐจ๋‹จ ์ทจ์†Œ = async (): Promise<์œ ์ € ์ฐจ๋‹จ ์ทจ์†ŒResponse> => {
const res = await axiosInstance.delete<์œ ์ € ์ฐจ๋‹จ ์ทจ์†ŒResponse>(
`{`
);
return res.data;
};

const use์œ ์ € ์ฐจ๋‹จ ์ทจ์†Œ = () => {
return useMutation<์œ ์ € ์ฐจ๋‹จ ์ทจ์†ŒResponse, AxiosError, ์œ ์ € ์ฐจ๋‹จ ์ทจ์†ŒRequest>({
mutationFn: (data) => ์œ ์ € ์ฐจ๋‹จ ์ทจ์†Œ({ data }),
});
};

export default use์œ ์ € ์ฐจ๋‹จ ์ทจ์†Œ;
22 changes: 22 additions & 0 deletions src/apis/Solid Connection/delete-ํšŒ์› ํƒˆํ‡ด.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { AxiosError } from "axios";
import { axiosInstance } from "@/utils/axiosInstance";
import { useMutation } from "@tanstack/react-query";

export interface ํšŒ์› ํƒˆํ‡ดRequest {
// TODO: Define request type
}

const ํšŒ์› ํƒˆํ‡ด = async (): Promise<ํšŒ์› ํƒˆํ‡ดResponse> => {
const res = await axiosInstance.delete<ํšŒ์› ํƒˆํ‡ดResponse>(
`{`
);
return res.data;
};

const useํšŒ์› ํƒˆํ‡ด = () => {
return useMutation<ํšŒ์› ํƒˆํ‡ดResponse, AxiosError, ํšŒ์› ํƒˆํ‡ดRequest>({
mutationFn: (data) => ํšŒ์› ํƒˆํ‡ด({ data }),
});
};

export default useํšŒ์› ํƒˆํ‡ด;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { AxiosError } from "axios";
import { axiosInstance } from "@/utils/axiosInstance";
import { QueryKeys } from "../queryKeys";
import { useQuery } from "@tanstack/react-query";

const ๊ฒŒ์‹œ๊ธ€ ์กฐํšŒ = async (params: { params?: Record<string, any> }): Promise<๊ฒŒ์‹œ๊ธ€ ์กฐํšŒResponse> => {
const res = await axiosInstance.get<๊ฒŒ์‹œ๊ธ€ ์กฐํšŒResponse>(
`{`, { params: params?.params }
);
return res.data;
};

const use๊ฒŒ์‹œ๊ธ€ ์กฐํšŒ = (params?: Record<string, any>) => {
return useQuery<๊ฒŒ์‹œ๊ธ€ ์กฐํšŒResponse, AxiosError>({
queryKey: [QueryKeys.solid Connection.๊ฒŒ์‹œ๊ธ€ ์กฐํšŒ, params],
queryFn: () => ๊ฒŒ์‹œ๊ธ€ ์กฐํšŒ({ params }),
});
};

export default use๊ฒŒ์‹œ๊ธ€ ์กฐํšŒ;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { AxiosError } from "axios";
import { axiosInstance } from "@/utils/axiosInstance";
import { QueryKeys } from "../queryKeys";
import { useQuery } from "@tanstack/react-query";

const ๊ฒŒ์‹œํŒ ๋ชฉ๋ก ์กฐํšŒ = async (params: { params?: Record<string, any> }): Promise<๊ฒŒ์‹œํŒ ๋ชฉ๋ก ์กฐํšŒResponse> => {
const res = await axiosInstance.get<๊ฒŒ์‹œํŒ ๋ชฉ๋ก ์กฐํšŒResponse>(
`{`, { params: params?.params }
);
return res.data;
};

const use๊ฒŒ์‹œํŒ ๋ชฉ๋ก ์กฐํšŒ = (params?: Record<string, any>) => {
return useQuery<๊ฒŒ์‹œํŒ ๋ชฉ๋ก ์กฐํšŒResponse, AxiosError>({
queryKey: [QueryKeys.solid Connection.๊ฒŒ์‹œํŒ ๋ชฉ๋ก ์กฐํšŒ, params],
queryFn: () => ๊ฒŒ์‹œํŒ ๋ชฉ๋ก ์กฐํšŒ({ params }),
});
};

export default use๊ฒŒ์‹œํŒ ๋ชฉ๋ก ์กฐํšŒ;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { AxiosError } from "axios";
import { axiosInstance } from "@/utils/axiosInstance";
import { QueryKeys } from "../queryKeys";
import { useQuery } from "@tanstack/react-query";

const ๊ฒŒ์‹œํŒ ์กฐํšŒ = async (params: { params?: Record<string, any> }): Promise<๊ฒŒ์‹œํŒ ์กฐํšŒResponse> => {
const res = await axiosInstance.get<๊ฒŒ์‹œํŒ ์กฐํšŒResponse>(
`{`, { params: params?.params }
);
return res.data;
};

const use๊ฒŒ์‹œํŒ ์กฐํšŒ = (params?: Record<string, any>) => {
return useQuery<๊ฒŒ์‹œํŒ ์กฐํšŒResponse, AxiosError>({
queryKey: [QueryKeys.solid Connection.๊ฒŒ์‹œํŒ ์กฐํšŒ, params],
queryFn: () => ๊ฒŒ์‹œํŒ ์กฐํšŒ({ params }),
});
};

export default use๊ฒŒ์‹œํŒ ์กฐํšŒ;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { AxiosError } from "axios";
import { axiosInstance } from "@/utils/axiosInstance";
import { QueryKeys } from "../queryKeys";
import { useQuery } from "@tanstack/react-query";

const ๊ถŒ์—ญ๊ตญ๊ฐ€์— ํ•ด๋‹นํ•˜๋Š” ์ „์ฒด ๋Œ€ํ•™ = async (params: { params?: Record<string, any> }): Promise<๊ถŒ์—ญ๊ตญ๊ฐ€์— ํ•ด๋‹นํ•˜๋Š” ์ „์ฒด ๋Œ€ํ•™Response> => {
const res = await axiosInstance.get<๊ถŒ์—ญ๊ตญ๊ฐ€์— ํ•ด๋‹นํ•˜๋Š” ์ „์ฒด ๋Œ€ํ•™Response>(
`{`, { params: params?.params }
);
return res.data;
};

const use๊ถŒ์—ญ๊ตญ๊ฐ€์— ํ•ด๋‹นํ•˜๋Š” ์ „์ฒด ๋Œ€ํ•™ = (params?: Record<string, any>) => {
return useQuery<๊ถŒ์—ญ๊ตญ๊ฐ€์— ํ•ด๋‹นํ•˜๋Š” ์ „์ฒด ๋Œ€ํ•™Response, AxiosError>({
queryKey: [QueryKeys.solid Connection.๊ถŒ์—ญ๊ตญ๊ฐ€์— ํ•ด๋‹นํ•˜๋Š” ์ „์ฒด ๋Œ€ํ•™, params],
queryFn: () => ๊ถŒ์—ญ๊ตญ๊ฐ€์— ํ•ด๋‹นํ•˜๋Š” ์ „์ฒด ๋Œ€ํ•™({ params }),
});
};

export default use๊ถŒ์—ญ๊ตญ๊ฐ€์— ํ•ด๋‹นํ•˜๋Š” ์ „์ฒด ๋Œ€ํ•™;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { AxiosError } from "axios";
import { axiosInstance } from "@/utils/axiosInstance";
import { QueryKeys } from "../queryKeys";
import { useQuery } from "@tanstack/react-query";

const ๋‚˜์˜ ๋ฉ˜ํ†  ํŽ˜์ด์ง€ ์กฐํšŒ = async (params: { params?: Record<string, any> }): Promise<๋‚˜์˜ ๋ฉ˜ํ†  ํŽ˜์ด์ง€ ์กฐํšŒResponse> => {
const res = await axiosInstance.get<๋‚˜์˜ ๋ฉ˜ํ†  ํŽ˜์ด์ง€ ์กฐํšŒResponse>(
`{`, { params: params?.params }
);
return res.data;
};

const use๋‚˜์˜ ๋ฉ˜ํ†  ํŽ˜์ด์ง€ ์กฐํšŒ = (params?: Record<string, any>) => {
return useQuery<๋‚˜์˜ ๋ฉ˜ํ†  ํŽ˜์ด์ง€ ์กฐํšŒResponse, AxiosError>({
queryKey: [QueryKeys.solid Connection.๋‚˜์˜ ๋ฉ˜ํ†  ํŽ˜์ด์ง€ ์กฐํšŒ, params],
queryFn: () => ๋‚˜์˜ ๋ฉ˜ํ†  ํŽ˜์ด์ง€ ์กฐํšŒ({ params }),
});
};

export default use๋‚˜์˜ ๋ฉ˜ํ†  ํŽ˜์ด์ง€ ์กฐํšŒ;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { AxiosError } from "axios";
import { axiosInstance } from "@/utils/axiosInstance";
import { QueryKeys } from "../queryKeys";
import { useQuery } from "@tanstack/react-query";

const ๋‚˜์˜ ์ง€์›๊ณผ ๋™์ผํ•œ ์ง€์›์ž ํ˜„ํ™ฉ ์กฐํšŒ = async (params: { params?: Record<string, any> }): Promise<๋‚˜์˜ ์ง€์›๊ณผ ๋™์ผํ•œ ์ง€์›์ž ํ˜„ํ™ฉ ์กฐํšŒResponse> => {
const res = await axiosInstance.get<๋‚˜์˜ ์ง€์›๊ณผ ๋™์ผํ•œ ์ง€์›์ž ํ˜„ํ™ฉ ์กฐํšŒResponse>(
`{`, { params: params?.params }
);
return res.data;
};

const use๋‚˜์˜ ์ง€์›๊ณผ ๋™์ผํ•œ ์ง€์›์ž ํ˜„ํ™ฉ ์กฐํšŒ = (params?: Record<string, any>) => {
return useQuery<๋‚˜์˜ ์ง€์›๊ณผ ๋™์ผํ•œ ์ง€์›์ž ํ˜„ํ™ฉ ์กฐํšŒResponse, AxiosError>({
queryKey: [QueryKeys.solid Connection.๋‚˜์˜ ์ง€์›๊ณผ ๋™์ผํ•œ ์ง€์›์ž ํ˜„ํ™ฉ ์กฐํšŒ, params],
queryFn: () => ๋‚˜์˜ ์ง€์›๊ณผ ๋™์ผํ•œ ์ง€์›์ž ํ˜„ํ™ฉ ์กฐํšŒ({ params }),
});
};

export default use๋‚˜์˜ ์ง€์›๊ณผ ๋™์ผํ•œ ์ง€์›์ž ํ˜„ํ™ฉ ์กฐํšŒ;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { AxiosError } from "axios";
import { axiosInstance } from "@/utils/axiosInstance";
import { QueryKeys } from "../queryKeys";
import { useQuery } from "@tanstack/react-query";

const ๋‚ด ์ •๋ณด ์กฐํšŒ = async (params: { params?: Record<string, any> }): Promise<๋‚ด ์ •๋ณด ์กฐํšŒResponse> => {
const res = await axiosInstance.get<๋‚ด ์ •๋ณด ์กฐํšŒResponse>(
`{`, { params: params?.params }
);
return res.data;
};

const use๋‚ด ์ •๋ณด ์กฐํšŒ = (params?: Record<string, any>) => {
return useQuery<๋‚ด ์ •๋ณด ์กฐํšŒResponse, AxiosError>({
queryKey: [QueryKeys.solid Connection.๋‚ด ์ •๋ณด ์กฐํšŒ, params],
queryFn: () => ๋‚ด ์ •๋ณด ์กฐํšŒ({ params }),
});
};

export default use๋‚ด ์ •๋ณด ์กฐํšŒ;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { AxiosError } from "axios";
import { axiosInstance } from "@/utils/axiosInstance";
import { QueryKeys } from "../queryKeys";
import { useQuery } from "@tanstack/react-query";

const ๋‹‰๋„ค์ž„ ์ค‘๋ณต ๊ฒ€์ฆ = async (params: { params?: Record<string, any> }): Promise<๋‹‰๋„ค์ž„ ์ค‘๋ณต ๊ฒ€์ฆResponse> => {
const res = await axiosInstance.get<๋‹‰๋„ค์ž„ ์ค‘๋ณต ๊ฒ€์ฆResponse>(
`{`, { params: params?.params }
);
return res.data;
};

const use๋‹‰๋„ค์ž„ ์ค‘๋ณต ๊ฒ€์ฆ = (params?: Record<string, any>) => {
return useQuery<๋‹‰๋„ค์ž„ ์ค‘๋ณต ๊ฒ€์ฆResponse, AxiosError>({
queryKey: [QueryKeys.solid Connection.๋‹‰๋„ค์ž„ ์ค‘๋ณต ๊ฒ€์ฆ, params],
queryFn: () => ๋‹‰๋„ค์ž„ ์ค‘๋ณต ๊ฒ€์ฆ({ params }),
});
};

export default use๋‹‰๋„ค์ž„ ์ค‘๋ณต ๊ฒ€์ฆ;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { AxiosError } from "axios";
import { axiosInstance } from "@/utils/axiosInstance";
import { QueryKeys } from "../queryKeys";
import { useQuery } from "@tanstack/react-query";

const ๋งค์นญ๋œ ๋ฉ˜ํ†  ๋ชฉ๋ก = async (params: { params?: Record<string, any> }): Promise<๋งค์นญ๋œ ๋ฉ˜ํ†  ๋ชฉ๋กResponse> => {
const res = await axiosInstance.get<๋งค์นญ๋œ ๋ฉ˜ํ†  ๋ชฉ๋กResponse>(
`{`, { params: params?.params }
);
return res.data;
};

const use๋งค์นญ๋œ ๋ฉ˜ํ†  ๋ชฉ๋ก = (params?: Record<string, any>) => {
return useQuery<๋งค์นญ๋œ ๋ฉ˜ํ†  ๋ชฉ๋กResponse, AxiosError>({
queryKey: [QueryKeys.solid Connection.๋งค์นญ๋œ ๋ฉ˜ํ†  ๋ชฉ๋ก, params],
queryFn: () => ๋งค์นญ๋œ ๋ฉ˜ํ†  ๋ชฉ๋ก({ params }),
});
};

export default use๋งค์นญ๋œ ๋ฉ˜ํ†  ๋ชฉ๋ก;
Loading