juzhiyuan commented on a change in pull request #451:
URL: https://github.com/apache/apisix-dashboard/pull/451#discussion_r484855909
##########
File path: src/pages/Route/transform.ts
##########
@@ -53,11 +53,17 @@ export const transformStepData = ({
protocols = protocols.concat('websocket');
}
+ let { status } = step1Data;
+ if (step1Data.status === undefined) {
Review comment:
status should be always a number or string flag I think, why this will
have the `undefined` case? 🤔
##########
File path: src/pages/Route/service.ts
##########
@@ -50,6 +50,8 @@ export const fetchList = ({ current = 1, pageSize = 10 },
search: string) => {
};
export const remove = (rid: number) => request(`/routes/${rid}`, { method:
'DELETE' });
+export const offline = (rid: number) => request(`/offlineroutes/${rid}`, {
method: 'PUT' });
+export const publish = (rid: number) => request(`/publishroutes/${rid}`, {
method: 'PUT' });
Review comment:
Not a good Pathname for this module, I would prefer using `PUT
/routes/${rid}/offline` if possible.
##########
File path: src/pages/Route/components/Step1/MetaView.tsx
##########
@@ -43,6 +43,15 @@ const MetaView: React.FC<Props> = ({ disabled }) => {
disabled={disabled}
/>
</Form.Item>
+ {!isEdit ? (
Review comment:
we could use `&&` here
##########
File path: src/pages/Route/Create.tsx
##########
@@ -14,21 +14,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import React, { useState, useEffect } from 'react';
-import { Card, Steps, Form } from 'antd';
+import React, { useEffect, useState } from 'react';
+import { Card, Form, Steps } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history, useIntl } from 'umi';
import { transformer as chartTransformer } from '@api7-dashboard/pluginchart';
import ActionBar from '@/components/ActionBar';
import {
+ checkHostWithSSL,
+ checkUniqueName,
create,
fetchItem,
- update,
- checkUniqueName,
fetchUpstreamItem,
- checkHostWithSSL,
+ update,
Review comment:
I don't see any changes here except the import order, if there have no
needs, please keep the previous order.
##########
File path: src/pages/Route/typing.d.ts
##########
@@ -113,6 +116,8 @@ declare namespace RouteModule {
// Request Body or Response Data for API
type Body = {
id?: number;
+ env: string;
Review comment:
Does this is a form field or?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]