File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ import { FormTOCBox } from '@/components/form-slice/FormSection';
32
32
import PageHeader from '@/components/page/PageHeader' ;
33
33
import { req } from '@/config/req' ;
34
34
import type { APISIXType } from '@/types/schema/apisix' ;
35
+ import { produceRmUpstreamWhenHas } from '@/utils/form-producer' ;
35
36
import { pipeProduce } from '@/utils/producer' ;
36
37
37
38
type Props = {
@@ -45,7 +46,10 @@ export const StreamRouteAddForm = (props: Props) => {
45
46
46
47
const postStreamRoute = useMutation ( {
47
48
mutationFn : ( d : StreamRoutePostType ) =>
48
- postStreamRouteReq ( req , pipeProduce ( ) ( d ) ) ,
49
+ postStreamRouteReq (
50
+ req ,
51
+ pipeProduce ( produceRmUpstreamWhenHas ( 'service_id' ) ) ( d )
52
+ ) ,
49
53
async onSuccess ( res ) {
50
54
notifications . show ( {
51
55
message : t ( 'info.add.success' , { name : t ( 'streamRoutes.singular' ) } ) ,
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import PageHeader from '@/components/page/PageHeader';
39
39
import { API_STREAM_ROUTES } from '@/config/constant' ;
40
40
import { req } from '@/config/req' ;
41
41
import { APISIX , type APISIXType } from '@/types/schema/apisix' ;
42
+ import { produceRmUpstreamWhenHas } from '@/utils/form-producer' ;
42
43
import { pipeProduce } from '@/utils/producer' ;
43
44
44
45
type Props = {
@@ -70,7 +71,10 @@ const StreamRouteDetailForm = (props: Props) => {
70
71
71
72
const putStreamRoute = useMutation ( {
72
73
mutationFn : ( d : APISIXType [ 'StreamRoute' ] ) =>
73
- putStreamRouteReq ( req , pipeProduce ( ) ( d ) ) ,
74
+ putStreamRouteReq (
75
+ req ,
76
+ pipeProduce ( produceRmUpstreamWhenHas ( 'service_id' ) ) ( d )
77
+ ) ,
74
78
async onSuccess ( ) {
75
79
notifications . show ( {
76
80
message : t ( 'info.edit.success' , { name : t ( 'streamRoutes.singular' ) } ) ,
You can’t perform that action at this time.
0 commit comments