mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-09 23:48:36 +01:00
18 lines
388 B
TypeScript
18 lines
388 B
TypeScript
|
|
import { FeedbackModel } from '@schema/FeedbackSchema';
|
|
|
|
export default defineEventHandler(async event => {
|
|
const data = await getRequestData(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 }
|
|
|
|
}); |