blob: f58c146bbce03a3e94681d8ec98fbfd5f47dde8a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
// src/app/api/cron/tag-form-mappings/route.ts
import { syncTagFormMappings } from '@/lib/sedp/sync-form';
import { NextRequest } from 'next/server';
export async function GET(request: NextRequest) {
try {
console.log('태그 폼 매핑 동기화 API 호출됨:', new Date().toISOString());
// syncTagFormMappings 함수 호출
const result = await syncTagFormMappings();
// 성공 시 결과와 함께 200 OK 반환
return Response.json({ success: true, result }, { status: 200 });
} catch (error: any) {
console.error('태그 폼 매핑 동기화 API 에러:', error);
// 에러 시에는 message를 담아 500 반환
const message = error.message || 'Something went wrong';
return Response.json({ success: false, error: message }, { status: 500 });
}
}
|