mirror of
https://github.com/ershisan99/coolify.git
synced 2026-01-25 12:34:32 +00:00
19
src/routes/destinations/index.json.ts
Normal file
19
src/routes/destinations/index.json.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { getTeam, getUserDetails } from '$lib/common';
|
||||
import * as db from '$lib/database';
|
||||
import { PrismaErrorHandler } from '$lib/database';
|
||||
import type { RequestHandler } from '@sveltejs/kit';
|
||||
|
||||
export const get: RequestHandler = async (request) => {
|
||||
const { teamId, status, body } = await getUserDetails(request);
|
||||
if (status === 401) return { status, body };
|
||||
|
||||
try {
|
||||
return {
|
||||
body: {
|
||||
destinations: await db.listDestinations(teamId)
|
||||
}
|
||||
};
|
||||
} catch (error) {
|
||||
return PrismaErrorHandler(error);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user