fix: ui;perf: docs

This commit is contained in:
archer
2023-05-14 22:04:19 +08:00
parent d31bdf0ee0
commit ca99837dab
6 changed files with 20 additions and 14 deletions

View File

@@ -1,6 +1,6 @@
import type { NextApiRequest, NextApiResponse } from 'next';
import { jsonRes } from '@/service/response';
import { Chat, Model, connectToDatabase, Collection } from '@/service/mongo';
import { Chat, Model, connectToDatabase, Collection, ShareChat } from '@/service/mongo';
import { authToken } from '@/service/utils/auth';
import { PgClient } from '@/service/pg';
import { authModel } from '@/service/utils/auth';
@@ -40,6 +40,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
modelId
});
// 删除分享链接
await ShareChat.deleteMany({
modelId
});
// 删除模型
await Model.deleteOne({
_id: modelId,