- Renamed project from PSA-Utils to Pulse - Moved all app files from autotask-app/ to root - Updated package.json name to 'pulse' - Updated Docker container names to pulse-app and pulse-redis - Updated Docker network name to pulse-network
24 lines
639 B
TypeScript
24 lines
639 B
TypeScript
import { NextResponse } from 'next/server';
|
|
import { getAddigyClient } from '@/lib/services/addigy-factory';
|
|
|
|
export async function GET(request: Request) {
|
|
try {
|
|
const addigyClient = getAddigyClient();
|
|
const policies = await addigyClient.getAllPolicies();
|
|
|
|
return NextResponse.json({
|
|
success: true,
|
|
data: policies,
|
|
count: policies.length,
|
|
});
|
|
} catch (error) {
|
|
console.error('Error fetching Addigy policies:', error);
|
|
return NextResponse.json(
|
|
{
|
|
success: false,
|
|
error: error instanceof Error ? error.message : 'Unknown error',
|
|
},
|
|
{ status: 500 }
|
|
);
|
|
}
|
|
}
|