From 48013d14411ebd6e38a34583a8d0d348d65f71f6 Mon Sep 17 00:00:00 2001 From: P PUNITH KRISHNA <32421081+punith300i@users.noreply.github.com> Date: Fri, 27 Oct 2023 18:47:19 -0700 Subject: [PATCH] Fixed code reviews, updated transformation payload --- www/src/models/transformation/TransformationStore.ts | 4 ++-- www/src/pages/table/forms/TransformationForm.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/www/src/models/transformation/TransformationStore.ts b/www/src/models/transformation/TransformationStore.ts index 6679d8f..717d820 100644 --- a/www/src/models/transformation/TransformationStore.ts +++ b/www/src/models/transformation/TransformationStore.ts @@ -17,7 +17,7 @@ export class TransformationStore extends SimpleCRUDStore return errorMessage.split(':').splice(1).join(':').trim(); } - async testTransformation(id: number, payload: TPayload): Promise { + async testTransformation(id: number, payload: Transformation): Promise { let resp: any = await axios .post(`${SERVER}/api/transform/1/transformations`, payload) .then((res) => res.data) @@ -26,7 +26,7 @@ export class TransformationStore extends SimpleCRUDStore }; } -export class TPayload { +export class Transformation { public type?: string; public mode?: string; public datapath?: string[]; diff --git a/www/src/pages/table/forms/TransformationForm.tsx b/www/src/pages/table/forms/TransformationForm.tsx index b4a848f..fccdc30 100644 --- a/www/src/pages/table/forms/TransformationForm.tsx +++ b/www/src/pages/table/forms/TransformationForm.tsx @@ -18,7 +18,7 @@ import { useRef, useState } from "react"; import Editor from "@monaco-editor/react"; import { TransformationTable, useStores } from "../../../models"; import { - TPayload + Transformation } from "../../../models/transformation/TransformationStore"; const styles = { @@ -70,7 +70,7 @@ export const TransformationForm = withStyles(styles)( ]; const onExecute = async () => { - const transformPayload = new TPayload(); + const transformPayload = new Transformation(); transformPayload.type = form.getFieldValue("type"); transformPayload.code = form.getFieldValue("code"); transformPayload.mode = "restrictedpython";