This is an automated email from the ASF dual-hosted git repository. baoyuan pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git
The following commit(s) were added to refs/heads/master by this push: new d46d627f6 fix(stream_routes): rm upstream when has service_id (#3120) d46d627f6 is described below commit d46d627f621764c50d038190790002515a5f9d3e Author: YYYoung <isk...@outlook.com> AuthorDate: Mon Jun 16 09:22:26 2025 +0800 fix(stream_routes): rm upstream when has service_id (#3120) --- src/routes/stream_routes/add.tsx | 6 +++++- src/routes/stream_routes/detail.$id.tsx | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/routes/stream_routes/add.tsx b/src/routes/stream_routes/add.tsx index bec082e8e..9131aa76c 100644 --- a/src/routes/stream_routes/add.tsx +++ b/src/routes/stream_routes/add.tsx @@ -32,6 +32,7 @@ import { FormTOCBox } from '@/components/form-slice/FormSection'; import PageHeader from '@/components/page/PageHeader'; import { req } from '@/config/req'; import type { APISIXType } from '@/types/schema/apisix'; +import { produceRmUpstreamWhenHas } from '@/utils/form-producer'; import { pipeProduce } from '@/utils/producer'; type Props = { @@ -45,7 +46,10 @@ export const StreamRouteAddForm = (props: Props) => { const postStreamRoute = useMutation({ mutationFn: (d: StreamRoutePostType) => - postStreamRouteReq(req, pipeProduce()(d)), + postStreamRouteReq( + req, + pipeProduce(produceRmUpstreamWhenHas('service_id'))(d) + ), async onSuccess(res) { notifications.show({ message: t('info.add.success', { name: t('streamRoutes.singular') }), diff --git a/src/routes/stream_routes/detail.$id.tsx b/src/routes/stream_routes/detail.$id.tsx index 4232e95d0..e9f641a7f 100644 --- a/src/routes/stream_routes/detail.$id.tsx +++ b/src/routes/stream_routes/detail.$id.tsx @@ -39,6 +39,7 @@ import PageHeader from '@/components/page/PageHeader'; import { API_STREAM_ROUTES } from '@/config/constant'; import { req } from '@/config/req'; import { APISIX, type APISIXType } from '@/types/schema/apisix'; +import { produceRmUpstreamWhenHas } from '@/utils/form-producer'; import { pipeProduce } from '@/utils/producer'; type Props = { @@ -70,7 +71,10 @@ const StreamRouteDetailForm = (props: Props) => { const putStreamRoute = useMutation({ mutationFn: (d: APISIXType['StreamRoute']) => - putStreamRouteReq(req, pipeProduce()(d)), + putStreamRouteReq( + req, + pipeProduce(produceRmUpstreamWhenHas('service_id'))(d) + ), async onSuccess() { notifications.show({ message: t('info.edit.success', { name: t('streamRoutes.singular') }),