From c0b1a12766a96432acf75535a17879352f0dacda Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Tue, 27 Jun 2023 17:59:57 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(API/index.ts):=20add=20front?= =?UTF-8?q?end=5Fnode=20parameter=20to=20checkPrompt=20function=20to=20fix?= =?UTF-8?q?=20validation=20errors=20The=20checkPrompt=20function=20was=20n?= =?UTF-8?q?ot=20properly=20validating=20prompts=20due=20to=20missing=20fro?= =?UTF-8?q?ntend=5Fnode=20parameter.=20The=20fix=20adds=20the=20frontend?= =?UTF-8?q?=5Fnode=20parameter=20to=20the=20function=20and=20passes=20it?= =?UTF-8?q?=20to=20the=20axios.post=20request.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/controllers/API/index.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/controllers/API/index.ts b/src/frontend/src/controllers/API/index.ts index 2651a0058..e6848d1d4 100644 --- a/src/frontend/src/controllers/API/index.ts +++ b/src/frontend/src/controllers/API/index.ts @@ -4,6 +4,7 @@ import { errorsTypeAPI, InitTypeAPI, UploadFileTypeAPI, + APIClassType, } from "./../../types/api/index"; import { APIObjectType, sendAllProps } from "../../types/api/index"; import axios, { AxiosResponse } from "axios"; @@ -56,9 +57,13 @@ export async function postValidateCode( * @returns {Promise>} A promise that resolves to an AxiosResponse containing the validation results. */ export async function checkPrompt( - template: string + template: string, + frontend_node: APIClassType ): Promise> { - return await axios.post("/api/v1/validate/prompt", { template }); + return await axios.post("/api/v1/validate/prompt", { + template: template, + frontend_node: frontend_node, + }); } /**