Skip to content

Commit

Permalink
fix: duplicate ID (apache#2501)
Browse files Browse the repository at this point in the history
(cherry picked from commit 5f44089)
  • Loading branch information
SkyeYoung authored and bzp2010 committed Jul 13, 2022
1 parent be8ca92 commit 022d196
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion web/src/pages/Route/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,17 @@ const Page: React.FC<Props> = (props) => {
step3Data,
advancedMatchingRules,
} as RouteModule.RequestData;
if (props.route.path.indexOf('edit') !== -1) {

const { path } = props.route

if (path.indexOf('edit') !== -1) {
update((props as any).match.params.rid, routeData).then(() => {
setStep(5);
});
} else {
if (path.indexOf('duplicate') !== -1) {
delete routeData.form1Data.id
}
create(routeData).then(() => {
setStep(5);
});
Expand Down
1 change: 1 addition & 0 deletions web/src/pages/Route/typing.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ declare namespace RouteModule {
};

type Form1Data = {
id?: string;
name: string;
desc: string;
custom_version_label: string;
Expand Down

0 comments on commit 022d196

Please sign in to comment.