mirror of
https://github.com/labring/FastGPT.git
synced 2026-05-16 01:09:01 +08:00
@@ -0,0 +1,4 @@
|
||||
import { NextAPI } from '@/service/middleware/entry';
|
||||
import { handler } from './history/clearHistories';
|
||||
|
||||
export default NextAPI(handler);
|
||||
@@ -0,0 +1,4 @@
|
||||
import { NextAPI } from '@/service/middleware/entry';
|
||||
import { handler } from './history/delHistory';
|
||||
|
||||
export default NextAPI(handler);
|
||||
@@ -0,0 +1,4 @@
|
||||
import { NextAPI } from '@/service/middleware/entry';
|
||||
import { handler } from './history/getHistories';
|
||||
|
||||
export default NextAPI(handler);
|
||||
@@ -9,7 +9,6 @@ import { getS3ChatSource } from '@fastgpt/service/common/s3/sources/chat';
|
||||
import { authApp } from '@fastgpt/service/support/permission/app/auth';
|
||||
import { AppReadChatLogPerVal } from '@fastgpt/global/support/permission/app/constant';
|
||||
import { ChatBatchDeleteBodySchema } from '@fastgpt/global/openapi/core/chat/history/api';
|
||||
import { UserError } from '@fastgpt/global/common/error/utils';
|
||||
|
||||
async function handler(req: ApiRequestProps, res: NextApiResponse) {
|
||||
const { appId, chatIds } = ChatBatchDeleteBodySchema.parse(req.body);
|
||||
|
||||
@@ -7,7 +7,7 @@ import { type ApiRequestProps } from '@fastgpt/service/type/next';
|
||||
import { authChatCrud } from '@/service/support/permission/auth/chat';
|
||||
|
||||
/* clear all chat histories of an app */
|
||||
async function handler(req: ApiRequestProps, res: NextApiResponse) {
|
||||
export async function handler(req: ApiRequestProps, res: NextApiResponse) {
|
||||
const { appId, shareId, outLinkUid, teamId, teamToken } = ClearChatHistoriesSchema.parse(
|
||||
req.query
|
||||
);
|
||||
|
||||
@@ -6,7 +6,7 @@ import { NextAPI } from '@/service/middleware/entry';
|
||||
import { type ApiRequestProps } from '@fastgpt/service/type/next';
|
||||
|
||||
/* delete single chat history (soft delete) */
|
||||
async function handler(req: ApiRequestProps, res: NextApiResponse) {
|
||||
export async function handler(req: ApiRequestProps, res: NextApiResponse) {
|
||||
const { appId, chatId } = DelChatHistorySchema.parse(req.query);
|
||||
|
||||
await authChatCrud({
|
||||
|
||||
@@ -14,7 +14,7 @@ import { parsePaginationRequest } from '@fastgpt/service/common/api/pagination';
|
||||
import { addMonths } from 'date-fns';
|
||||
|
||||
/* get chat histories list */
|
||||
async function handler(
|
||||
export async function handler(
|
||||
req: ApiRequestProps,
|
||||
_res: ApiResponseType
|
||||
): Promise<GetHistoriesResponseType> {
|
||||
|
||||
@@ -7,7 +7,7 @@ import { type ApiRequestProps } from '@fastgpt/service/type/next';
|
||||
import { WritePermissionVal } from '@fastgpt/global/support/permission/constant';
|
||||
|
||||
/* update chat history: title, customTitle, top */
|
||||
async function handler(req: ApiRequestProps, res: NextApiResponse) {
|
||||
export async function handler(req: ApiRequestProps, res: NextApiResponse) {
|
||||
const { appId, chatId, title, customTitle, top } = UpdateHistoryBodySchema.parse(req.body);
|
||||
await authChatCrud({
|
||||
req,
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
import { NextAPI } from '@/service/middleware/entry';
|
||||
import { handler } from './history/updateHistory';
|
||||
|
||||
export default NextAPI(handler);
|
||||
Reference in New Issue
Block a user