fix : API_URL -> NEXT_PUBLIC_API_URL 일괄 변경
This commit is contained in:
@@ -139,7 +139,7 @@ export async function getProcessList(params?: {
|
||||
if (params?.process_type) searchParams.set('process_type', params.process_type);
|
||||
|
||||
const { response, error } = await serverFetch(
|
||||
`${process.env.API_URL}/v1/processes?${searchParams.toString()}`,
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/v1/processes?${searchParams.toString()}`,
|
||||
{ method: 'GET', cache: 'no-store' }
|
||||
);
|
||||
|
||||
@@ -177,7 +177,7 @@ export async function getProcessList(params?: {
|
||||
*/
|
||||
export async function getProcessById(id: string): Promise<{ success: boolean; data?: Process; error?: string; __authError?: boolean }> {
|
||||
try {
|
||||
const { response, error } = await serverFetch(`${process.env.API_URL}/v1/processes/${id}`, {
|
||||
const { response, error } = await serverFetch(`${process.env.NEXT_PUBLIC_API_URL}/v1/processes/${id}`, {
|
||||
method: 'GET',
|
||||
cache: 'no-store',
|
||||
});
|
||||
@@ -210,7 +210,7 @@ export async function createProcess(data: ProcessFormData): Promise<{ success: b
|
||||
try {
|
||||
const apiData = transformFrontendToApi(data);
|
||||
|
||||
const { response, error } = await serverFetch(`${process.env.API_URL}/v1/processes`, {
|
||||
const { response, error } = await serverFetch(`${process.env.NEXT_PUBLIC_API_URL}/v1/processes`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(apiData),
|
||||
});
|
||||
@@ -243,7 +243,7 @@ export async function updateProcess(id: string, data: ProcessFormData): Promise<
|
||||
try {
|
||||
const apiData = transformFrontendToApi(data);
|
||||
|
||||
const { response, error } = await serverFetch(`${process.env.API_URL}/v1/processes/${id}`, {
|
||||
const { response, error } = await serverFetch(`${process.env.NEXT_PUBLIC_API_URL}/v1/processes/${id}`, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify(apiData),
|
||||
});
|
||||
@@ -274,7 +274,7 @@ export async function updateProcess(id: string, data: ProcessFormData): Promise<
|
||||
*/
|
||||
export async function deleteProcess(id: string): Promise<{ success: boolean; error?: string; __authError?: boolean }> {
|
||||
try {
|
||||
const { response, error } = await serverFetch(`${process.env.API_URL}/v1/processes/${id}`, {
|
||||
const { response, error } = await serverFetch(`${process.env.NEXT_PUBLIC_API_URL}/v1/processes/${id}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
|
||||
@@ -304,7 +304,7 @@ export async function deleteProcess(id: string): Promise<{ success: boolean; err
|
||||
*/
|
||||
export async function deleteProcesses(ids: string[]): Promise<{ success: boolean; deletedCount?: number; error?: string; __authError?: boolean }> {
|
||||
try {
|
||||
const { response, error } = await serverFetch(`${process.env.API_URL}/v1/processes`, {
|
||||
const { response, error } = await serverFetch(`${process.env.NEXT_PUBLIC_API_URL}/v1/processes`, {
|
||||
method: 'DELETE',
|
||||
body: JSON.stringify({ ids: ids.map((id) => parseInt(id, 10)) }),
|
||||
});
|
||||
@@ -335,7 +335,7 @@ export async function deleteProcesses(ids: string[]): Promise<{ success: boolean
|
||||
*/
|
||||
export async function toggleProcessActive(id: string): Promise<{ success: boolean; data?: Process; error?: string; __authError?: boolean }> {
|
||||
try {
|
||||
const { response, error } = await serverFetch(`${process.env.API_URL}/v1/processes/${id}/toggle`, {
|
||||
const { response, error } = await serverFetch(`${process.env.NEXT_PUBLIC_API_URL}/v1/processes/${id}/toggle`, {
|
||||
method: 'PATCH',
|
||||
});
|
||||
|
||||
@@ -370,7 +370,7 @@ export async function getProcessOptions(): Promise<{
|
||||
__authError?: boolean;
|
||||
}> {
|
||||
try {
|
||||
const { response, error } = await serverFetch(`${process.env.API_URL}/v1/processes/options`, {
|
||||
const { response, error } = await serverFetch(`${process.env.NEXT_PUBLIC_API_URL}/v1/processes/options`, {
|
||||
method: 'GET',
|
||||
cache: 'no-store',
|
||||
});
|
||||
@@ -416,7 +416,7 @@ export async function getProcessStats(): Promise<{
|
||||
__authError?: boolean;
|
||||
}> {
|
||||
try {
|
||||
const { response, error } = await serverFetch(`${process.env.API_URL}/v1/processes/stats`, {
|
||||
const { response, error } = await serverFetch(`${process.env.NEXT_PUBLIC_API_URL}/v1/processes/stats`, {
|
||||
method: 'GET',
|
||||
cache: 'no-store',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user