Skip to content

Commit

Permalink
Merge pull request #47 from School-of-Company/fix/program-api
Browse files Browse the repository at this point in the history
🔀 �프로그램 연수 신청 api 수정
  • Loading branch information
happytaeyoon authored Dec 2, 2024
2 parents ec44d18 + 198b595 commit dd7f5e3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { apiClient } from '@/shared/libs/apiClient';

export async function POST(
request: Request,
{ params }: { params: { expo_id: number } },
{ params }: { params: { trainingPro_id: number } },
) {
const body = await request.json();
const { expo_id } = params;
const { trainingPro_id } = params;
const cookieStore = cookies();
const accessToken = cookieStore.get('accessToken')?.value;

Expand All @@ -21,7 +21,11 @@ export async function POST(
: {};

try {
const response = await apiClient.post(`/form/${expo_id}`, body, config);
const response = await apiClient.post(
`/training/application/${trainingPro_id}`,
body,
config,
);
return NextResponse.json(response.data);
} catch (error) {
const axiosError = error as AxiosError<{ message: string }>;
Expand Down
9 changes: 6 additions & 3 deletions src/entities/application/ui/TrainingRadioGroup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,12 @@ TrainingRadioGroup.handleTrainingSubmit = async (
trainingId: string,
) => {
try {
const response = await axios.post(`/api/application/${selectedValue}`, {
trainingId,
});
const response = await axios.post(
`/api/training/application/${selectedValue}`,
{
trainingId,
},
);
return response.data;
} catch (error) {
console.error('Error submitting training:', error);
Expand Down

0 comments on commit dd7f5e3

Please sign in to comment.