mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-27 05:47:47 +00:00
Co-authored-by: 夏姜 <wenfengjiang.jwf@digital-engine.com> Co-authored-by: yhjun1026 <460342015@qq.com> Co-authored-by: aries_ckt <916701291@qq.com> Co-authored-by: wb-lh513319 <wb-lh513319@alibaba-inc.com>
15 lines
451 B
TypeScript
15 lines
451 B
TypeScript
import { connection } from '@/lib/dto/connect';
|
|
import FeedbackDTO, { FeedbackModal } from '../dto/models/feedback.dto';
|
|
|
|
export default async function saveFeedBack(data: Omit<FeedbackModal, 'id'>) {
|
|
const { content, imgUrl } = data;
|
|
try {
|
|
await connection();
|
|
const instance = await FeedbackDTO.create({ content, imgUrl });
|
|
return instance.toJSON();
|
|
} catch (e) {
|
|
console.log('[GET USERINFO ERROR]: ', e);
|
|
return null;
|
|
}
|
|
}
|