mirror of
https://github.com/ershisan99/coolify.git
synced 2025-12-31 12:34:03 +00:00
20 lines
506 B
TypeScript
20 lines
506 B
TypeScript
import { getTeam, getUserDetails } from '$lib/common';
|
|
import * as db from '$lib/database';
|
|
import { ErrorHandler } 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 ErrorHandler(error);
|
|
}
|
|
};
|