From 50a1160f1d835254af53abc14438a2aa0d71d074 Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Thu, 22 Jun 2023 02:42:01 -0400 Subject: [PATCH] fix(striker-ui-api): match method, path pattern for config striker --- striker-ui-api/src/routes/host.ts | 2 +- striker-ui-api/src/routes/init.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/striker-ui-api/src/routes/host.ts b/striker-ui-api/src/routes/host.ts index f0e1d39e..93c202ac 100644 --- a/striker-ui-api/src/routes/host.ts +++ b/striker-ui-api/src/routes/host.ts @@ -22,7 +22,7 @@ router .post('/', createHost) .post(CONNECTION_PATH, createHostConnection) .put('/prepare', prepareHost) - .put('/:hostUUID', updateHost) + .put('/:hostUUID?', updateHost) .delete(CONNECTION_PATH, deleteHostConnection); export default router; diff --git a/striker-ui-api/src/routes/init.ts b/striker-ui-api/src/routes/init.ts index 153d6130..1855060e 100644 --- a/striker-ui-api/src/routes/init.ts +++ b/striker-ui-api/src/routes/init.ts @@ -12,21 +12,23 @@ router .get( '/network-interface/:hostUUID?', assertInit({ - fail: ({ path }, response) => response.redirect(`/api${path}`), + fail: ({ path }, response) => response.redirect(307, `/api${path}`), }), getNetworkInterface, ) - .post( + .put( '/', assertInit({ - fail: (request, response) => response.redirect(`/api/host`), + fail: (request, response) => + response.redirect(307, `/api/host?handler=striker`), }), configStriker, ) .put( '/set-map-network', assertInit({ - fail: ({ path }, response) => response.redirect(`/api/command${path}`), + fail: ({ path }, response) => + response.redirect(307, `/api/command${path}`), }), setMapNetwork, );