From 20d65f7d2b70eb92cb7f9cf0b0ef81ac565dd817 Mon Sep 17 00:00:00 2001 From: hezc Date: Fri, 14 Apr 2023 15:07:48 +0800 Subject: [PATCH 1/2] Fix ApiDoc insertion update failure --- .../Document/components/AddAndUpdateApiDoc.js | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/routes/Document/components/AddAndUpdateApiDoc.js b/src/routes/Document/components/AddAndUpdateApiDoc.js index 913823224..2ab221be4 100644 --- a/src/routes/Document/components/AddAndUpdateApiDoc.js +++ b/src/routes/Document/components/AddAndUpdateApiDoc.js @@ -17,7 +17,7 @@ /* eslint-disable no-unused-expressions */ /* eslint-disable radix */ -import { Modal, Form, Input, Select, message } from "antd"; +import { Modal, Form, Input, Select, message,Radio } from "antd"; import React, { Component } from "react"; import PropTypes from "prop-types"; import { Method } from "./globalData"; @@ -42,6 +42,11 @@ const API_SOURCE_TYPE = [ "import swagger", "import yapi" ]; +const STATE_TYPE = [ + "unpublished", + "published", + "offline" +]; class AddAndUpdateApiDoc extends Component { static defaultProps = { @@ -277,9 +282,16 @@ class AddAndUpdateApiDoc extends Component { ], initialValue: state })( - + + {Object.values(STATE_TYPE).map((e, i) => { + return ( + + {e} + + ); + })} + + )} Date: Fri, 14 Apr 2023 22:33:28 +0800 Subject: [PATCH 2/2] Modify the array traversal method --- src/routes/Document/components/AddAndUpdateApiDoc.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/Document/components/AddAndUpdateApiDoc.js b/src/routes/Document/components/AddAndUpdateApiDoc.js index 2ab221be4..06083b7be 100644 --- a/src/routes/Document/components/AddAndUpdateApiDoc.js +++ b/src/routes/Document/components/AddAndUpdateApiDoc.js @@ -259,7 +259,7 @@ class AddAndUpdateApiDoc extends Component { initialValue: rpcType })( - {Object.values(API_SOURCE_TYPE).map((e, i) => { + {API_SOURCE_TYPE.map((e, i) => { return ( {e}