mirror of
https://github.com/ershisan99/coolify.git
synced 2026-01-28 21:02:05 +00:00
17
src/routes/applications/[id]/configuration/deploykey.json.ts
Normal file
17
src/routes/applications/[id]/configuration/deploykey.json.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import * as db from '$lib/database';
|
||||
import { PrismaErrorHandler } from '$lib/database';
|
||||
import type { RequestHandler } from '@sveltejs/kit';
|
||||
|
||||
export const post: RequestHandler = async (event) => {
|
||||
const { id } = event.params;
|
||||
let { deployKeyId } = await event.request.json();
|
||||
|
||||
deployKeyId = Number(deployKeyId);
|
||||
|
||||
try {
|
||||
await db.updateDeployKey({ id, deployKeyId });
|
||||
return { status: 201 };
|
||||
} catch (error) {
|
||||
return PrismaErrorHandler(error);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user