mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
add onboarding and feedback models
This commit is contained in:
18
dashboard/server/api/feedback/add.post.ts
Normal file
18
dashboard/server/api/feedback/add.post.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
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 }
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user