Skip to content
Closed
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,27 @@
import { AxiosError } from "axios";
import { axiosInstance } from "@/utils/axiosInstance";
import { useMutation } from "@tanstack/react-query";

export interface κ²Œμ‹œκΈ€ μ’‹μ•„μš” μ‚­μ œRequest {
// TODO: Define request type
}

export interface κ²Œμ‹œκΈ€ μ’‹μ•„μš” μ‚­μ œResponse {
likeCount: number;
isLiked: boolean;
}

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,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νšŒμ› νƒˆν‡΄;
49 changes: 49 additions & 0 deletions src/apis/Solid Connection/get-κ²Œμ‹œκΈ€ 쑰회.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { AxiosError } from "axios";
import { axiosInstance } from "@/utils/axiosInstance";
import { QueryKeys } from "../queryKeys";
import { useQuery } from "@tanstack/react-query";

export interface PostFindCommentResponsesItem {
id: number;
parentId: null;
content: string;
isOwner: boolean;
createdAt: string;
updatedAt: string;
postFindSiteUserResponse: PostFindSiteUserResponse;
}

export interface κ²Œμ‹œκΈ€ 쑰회Response {
id: number;
title: string;
content: string;
isQuestion: boolean;
likeCount: number;
viewCount: number;
commentCount: number;
postCategory: string;
isOwner: boolean;
isLiked: boolean;
createdAt: string;
updatedAt: string;
postFindBoardResponse: PostFindBoardResponse;
postFindSiteUserResponse: PostFindSiteUserResponse;
postFindCommentResponses: PostFindCommentResponsesItem[];
postFindPostImageResponses: any[];
}

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κ²Œμ‹œνŒ λͺ©λ‘ 쑰회;
20 changes: 20 additions & 0 deletions src/apis/Solid Connection/get-κ²Œμ‹œνŒ 쑰회.ts
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,39 @@
import { AxiosError } from "axios";
import { axiosInstance } from "@/utils/axiosInstance";
import { QueryKeys } from "../queryKeys";
import { useQuery } from "@tanstack/react-query";

export interface ChannelsItem {
type: string;
url: string;
}

export interface λ‚˜μ˜ λ©˜ν†  νŽ˜μ΄μ§€ 쑰회Response {
id: number;
profileImageUrl: null;
nickname: string;
country: string;
universityName: string;
term: string;
menteeCount: number;
hasBadge: boolean;
introduction: string;
passTip: string;
channels: ChannelsItem[];
}

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