feat: init inkl. docker configs
This commit is contained in:
27
src/pages/api/cv/[id]/update.ts
Normal file
27
src/pages/api/cv/[id]/update.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import type { APIRoute } from 'astro';
|
||||
import { updateCV } from '../../../../lib/db';
|
||||
|
||||
export const PUT: APIRoute = async ({ request, locals, params }) => {
|
||||
try {
|
||||
const user = locals.user;
|
||||
const id = params.id!;
|
||||
const body = await request.json();
|
||||
|
||||
updateCV(id, user.id, {
|
||||
title: body.title,
|
||||
template: body.template,
|
||||
settings: body.settings,
|
||||
public: body.public,
|
||||
});
|
||||
|
||||
return new Response(JSON.stringify({ ok: true }), {
|
||||
status: 200,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
} catch (err: any) {
|
||||
return new Response(JSON.stringify({ error: err.message }), {
|
||||
status: 500,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user