new selfhosted version

This commit is contained in:
antonio
2025-11-28 14:11:51 +01:00
parent afda29997d
commit 951860f67e
1046 changed files with 72586 additions and 574750 deletions

View File

@@ -1,18 +0,0 @@
import { FeedbackModel } from '@schema/FeedbackSchema';
export default defineEventHandler(async event => {
const data = await getRequestDataOld(event);
if (!data) return;
const { text } = await readBody(event);
const save = await FeedbackModel.create({
user_id: data.user.id,
project_id: data.project_id,
text
});
return { ok: true }
});

View File

@@ -0,0 +1,18 @@
import { FeedbackModel } from "~/shared/schema/FeedbackSchema";
export default defineEventHandler(async event => {
if (isSelfhosted()) return;
const ctx = await getRequestContext(event, 'pid');
const { project_id, user_id } = ctx;
const { text } = await readBody(event);
if (!text || typeof text != 'string' || text.length == 0) {
throw createError({ status: 400, message: 'Something went wrong.' })
}
await FeedbackModel.create({ project_id, user_id, text })
});