22 lines
554 B
TypeScript
22 lines
554 B
TypeScript
import { apiClient } from "./client";
|
|
import { SignupFormData, SignupResponse } from "@/types/auth";
|
|
|
|
/**
|
|
* 회원가입 API
|
|
*/
|
|
export async function signupUser(data: SignupFormData): Promise<SignupResponse> {
|
|
try {
|
|
const response = await apiClient.post<SignupResponse>("/auth/signup", data);
|
|
return response.data;
|
|
} catch (error: any) {
|
|
if (error.response?.data) {
|
|
return error.response.data;
|
|
}
|
|
return {
|
|
success: false,
|
|
message: error.message || "회원가입 중 오류가 발생했습니다",
|
|
};
|
|
}
|
|
}
|
|
|