Skip to content

Commit

Permalink
delete unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
newfish-cmyk committed Oct 13, 2024
1 parent bf8010c commit 0360ad5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 2 additions & 4 deletions packages/service/support/permission/app/auth.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* Auth app permission */
import { MongoApp } from '../../../core/app/schema';
import { AppDetailType, AppSchema } from '@fastgpt/global/core/app/type.d';
import { AppDetailType } from '@fastgpt/global/core/app/type.d';
import { parseHeaderCert } from '../controller';
import { AuthUserTypeEnum, PerResourceTypeEnum } from '@fastgpt/global/support/permission/constant';
import { PerResourceTypeEnum } from '@fastgpt/global/support/permission/constant';
import { AppErrEnum } from '@fastgpt/global/common/error/code/app';
import { getTmbInfoByTmbId } from '../../user/team/controller';
import { getResourcePermission } from '../controller';
Expand All @@ -13,8 +13,6 @@ import { ParentIdType } from '@fastgpt/global/common/parentFolder/type';
import { splitCombinePluginId } from '../../../core/app/plugin/controller';
import { PluginSourceEnum } from '@fastgpt/global/core/plugin/constants';
import { AuthModeType, AuthResponseType } from '../type';
import { NextApiRequest } from 'next';
import { authCert } from '../auth/common';

export const authPluginByTmbId = async ({
tmbId,
Expand Down
7 changes: 7 additions & 0 deletions projects/app/src/pages/api/core/chat/getPaginationRecords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ async function handler(
type = GetChatTypeEnum.normal
} = req.body;

if (!appId || !chatId) {
return {
list: [],
total: 0
};
}

const [app] = await Promise.all([
MongoApp.findById(appId, 'type').lean(),
authChatCrud({
Expand Down
3 changes: 1 addition & 2 deletions projects/app/src/pages/api/core/chat/item/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import { ApiRequestProps } from '@fastgpt/service/type/next';
import { WritePermissionVal } from '@fastgpt/global/support/permission/constant';

async function handler(req: ApiRequestProps<{}, DeleteChatItemProps>, res: NextApiResponse) {
const { chatId, contentId } = req.query;
const { appId, chatId, contentId } = req.query;

let appId = req.query.appId;
if (!contentId || !chatId) {
return jsonRes(res);
}
Expand Down

0 comments on commit 0360ad5

Please sign in to comment.