Skip to content

Commit

Permalink
4.8.10 test (#2499)
Browse files Browse the repository at this point in the history
* 48190 init

* path
  • Loading branch information
c121914yu authored Aug 24, 2024
1 parent bb7adc9 commit ace84f0
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
35 changes: 35 additions & 0 deletions projects/app/src/pages/api/admin/initv4810.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import type { NextApiRequest, NextApiResponse } from 'next';
import { jsonRes } from '@fastgpt/service/common/response';
import { connectToDatabase } from '@/service/mongo';
import { authCert } from '@fastgpt/service/support/permission/auth/common';
import { MongoDataset } from '@fastgpt/service/core/dataset/schema';
import { DatasetDefaultPermissionVal } from '@fastgpt/global/support/permission/dataset/constant';
import { MongoAppVersion } from '@fastgpt/service/core/app/version/schema';

/* pg 中的数据搬到 mongo dataset.datas 中,并做映射 */
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
try {
await connectToDatabase();
await authCert({ req, authRoot: true });

await MongoAppVersion.updateMany(
{},
{
$set: {
isPublish: true
}
}
);

jsonRes(res, {
message: 'success'
});
} catch (error) {
console.log(error);

jsonRes(res, {
code: 500,
error
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import MyIcon from '@fastgpt/web/components/common/Icon';
import { Box } from '@chakra-ui/react';
import { useTranslation } from 'react-i18next';
import styles from './index.module.scss';
import { maxZoom, minZoom } from '..';
import { maxZoom, minZoom } from '../index';

const FlowController = React.memo(function FlowController() {
const { fitView, zoomIn, zoomOut } = useReactFlow();
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/web/core/app/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { NullPermission } from '@fastgpt/global/support/permission/constant';
import { i18nT } from '@fastgpt/web/i18n/utils';
export const defaultApp: AppDetailType = {
_id: '',
name: i18nT('common:core.app.loading'),
name: 'AI',
type: AppTypeEnum.simple,
avatar: '/icon/logo.svg',
intro: '',
Expand Down

0 comments on commit ace84f0

Please sign in to comment.