Skip to content

Commit

Permalink
fix(web): fix deploy would clear params (#1224)
Browse files Browse the repository at this point in the history
  • Loading branch information
newfish-cmyk authored Jun 6, 2023
1 parent 060a393 commit 95bc353
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions web/src/pages/app/functions/mods/DebugPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ const HAS_BODY_PARAMS_METHODS: (TMethod | undefined)[] = ["POST", "PUT", "PATCH"

export default function DebugPanel(props: { containerRef: any; showOverlay: boolean }) {
const { t } = useTranslation();
const { getFunctionUrl, currentFunction, setCurrentRequestId } = useFunctionStore(
(state) => state,
);
const { getFunctionUrl, currentFunction, setCurrentFunction, setCurrentRequestId } =
useFunctionStore((state) => state);
const updateFunctionMutation = useUpdateFunctionMutation();
const globalStore = useGlobalStore((state) => state);

Expand Down Expand Up @@ -103,6 +102,8 @@ export default function DebugPanel(props: { containerRef: any; showOverlay: bool
params: params,
});

setCurrentFunction({ ...currentFunction, params: params });

if (!compileRes.error) {
const _funcData = JSON.stringify(compileRes.data);
const res = await axios({
Expand Down
1 change: 1 addition & 0 deletions web/src/pages/app/functions/mods/DeployButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default function DeployButton() {
websocket: store.currentFunction?.websocket,
name: store.currentFunction?.name,
tags: store.currentFunction?.tags,
params: store.currentFunction?.params,
});
if (!res.error) {
store.setCurrentFunction(res.data);
Expand Down

0 comments on commit 95bc353

Please sign in to comment.