lxbme commented on code in PR #3437:
URL: https://github.com/apache/apisix-dashboard/pull/3437#discussion_r3642452037
##########
src/components/form-slice/FormPartStreamRoute/util.ts:
##########
@@ -15,28 +15,33 @@
* limitations under the License.
*/
import { produce } from 'immer';
-import { pipe } from 'rambdax';
import { produceRmEmptyUpstreamFields } from
'@/components/form-slice/FormPartUpstream/util';
import { produceRmUpstreamWhenHas } from '@/utils/form-producer';
+import { pipeProduce } from '@/utils/producer';
import type { StreamRoutePostType } from './schema';
-export const produceStreamRoute = (val: StreamRoutePostType) =>
- pipe(
- produceRmEmptyUpstreamFields,
- (produceRmUpstreamWhenHas('service_id', 'upstream_id') as unknown as (
- d: StreamRoutePostType
- ) => StreamRoutePostType),
- produce((draft: StreamRoutePostType) => {
- // Stream Routes do not support name and status
- const d = draft as StreamRoutePostType & { name?: string; status?:
number };
- delete d.name;
- delete d.status;
+/**
+ * Shared by BOTH the create and edit paths — stream routes used to be the
+ * only resource whose two paths ran different cleaning pipelines (create
+ * skipped pipeProduce entirely; edit borrowed the HTTP-route producer).
+ * pipeProduce supplies the __-flag removal, empty-value cleaning and
+ * empty-plugin restore every other resource gets (#3417).
+ */
+export const produceStreamRoute = pipeProduce(
Review Comment:
#3438 has merged, so this branch is now rebased onto master — the diff is
back to just the two stream-route commits.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]