mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 14:35:55 +08:00
fix: import Explore Apps raise error (#11091)
This commit is contained in:
parent
ab6dcf7032
commit
60c1549771
@ -14,7 +14,7 @@ import type { App } from '@/models/explore'
|
|||||||
import Category from '@/app/components/explore/category'
|
import Category from '@/app/components/explore/category'
|
||||||
import AppCard from '@/app/components/explore/app-card'
|
import AppCard from '@/app/components/explore/app-card'
|
||||||
import { fetchAppDetail, fetchAppList } from '@/service/explore'
|
import { fetchAppDetail, fetchAppList } from '@/service/explore'
|
||||||
import { importApp } from '@/service/apps'
|
import { importDSL } from '@/service/apps'
|
||||||
import { useTabSearchParams } from '@/hooks/use-tab-searchparams'
|
import { useTabSearchParams } from '@/hooks/use-tab-searchparams'
|
||||||
import CreateAppModal from '@/app/components/explore/create-app-modal'
|
import CreateAppModal from '@/app/components/explore/create-app-modal'
|
||||||
import AppTypeSelector from '@/app/components/app/type-selector'
|
import AppTypeSelector from '@/app/components/app/type-selector'
|
||||||
@ -24,6 +24,7 @@ import { NEED_REFRESH_APP_LIST_KEY } from '@/config'
|
|||||||
import { useAppContext } from '@/context/app-context'
|
import { useAppContext } from '@/context/app-context'
|
||||||
import { getRedirection } from '@/utils/app-redirection'
|
import { getRedirection } from '@/utils/app-redirection'
|
||||||
import Input from '@/app/components/base/input'
|
import Input from '@/app/components/base/input'
|
||||||
|
import { DSLImportMode } from '@/models/app'
|
||||||
|
|
||||||
type AppsProps = {
|
type AppsProps = {
|
||||||
pageType?: PageType
|
pageType?: PageType
|
||||||
@ -127,8 +128,9 @@ const Apps = ({
|
|||||||
currApp?.app.id as string,
|
currApp?.app.id as string,
|
||||||
)
|
)
|
||||||
try {
|
try {
|
||||||
const app = await importApp({
|
const app = await importDSL({
|
||||||
data: export_data,
|
mode: DSLImportMode.YAML_CONTENT,
|
||||||
|
yaml_content: export_data,
|
||||||
name,
|
name,
|
||||||
icon_type,
|
icon_type,
|
||||||
icon,
|
icon,
|
||||||
|
@ -4,12 +4,12 @@ export const getRedirection = (
|
|||||||
redirectionFunc: (href: string) => void,
|
redirectionFunc: (href: string) => void,
|
||||||
) => {
|
) => {
|
||||||
if (!isCurrentWorkspaceEditor) {
|
if (!isCurrentWorkspaceEditor) {
|
||||||
redirectionFunc(`/app/${app.id}/overview`)
|
redirectionFunc(`/app/${app.app_id}/overview`)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (app.mode === 'workflow' || app.mode === 'advanced-chat')
|
if (app.mode === 'workflow' || app.mode === 'advanced-chat')
|
||||||
redirectionFunc(`/app/${app.id}/workflow`)
|
redirectionFunc(`/app/${app.app_id}/workflow`)
|
||||||
else
|
else
|
||||||
redirectionFunc(`/app/${app.id}/configuration`)
|
redirectionFunc(`/app/${app.app_id}/configuration`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user