Skip to content

Commit

Permalink
Fixed code reviews, updated transformation payload
Browse files Browse the repository at this point in the history
  • Loading branch information
punith300i committed Oct 28, 2023
1 parent d821a0e commit 48013d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions www/src/models/transformation/TransformationStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class TransformationStore extends SimpleCRUDStore<number, Transformation>
return errorMessage.split(':').splice(1).join(':').trim();
}

async testTransformation(id: number, payload: TPayload): Promise<TransformationResult[] | undefined> {
async testTransformation(id: number, payload: Transformation): Promise<TransformationResult[] | undefined> {
let resp: any = await axios
.post(`${SERVER}/api/transform/1/transformations`, payload)
.then((res) => res.data)
Expand All @@ -26,7 +26,7 @@ export class TransformationStore extends SimpleCRUDStore<number, Transformation>
};
}

export class TPayload {
export class Transformation {
public type?: string;
public mode?: string;
public datapath?: string[];
Expand Down
4 changes: 2 additions & 2 deletions www/src/pages/table/forms/TransformationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit 48013d1

Please sign in to comment.