From 67ffdcd0c71bd6f158a7b0f8cafd2eae14b975ae Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 3 Jul 2023 23:12:18 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore(API/index.ts):=20add=20nam?= =?UTF-8?q?e=20parameter=20to=20postValidatePrompt=20function=20for=20impr?= =?UTF-8?q?oved=20code=20readability=20The=20postValidatePrompt=20function?= =?UTF-8?q?=20now=20accepts=20a=20name=20parameter,=20which=20represents?= =?UTF-8?q?=20the=20name=20of=20the=20field=20to=20check.=20This=20change?= =?UTF-8?q?=20improves=20the=20code=20readability=20by=20explicitly=20spec?= =?UTF-8?q?ifying=20the=20name=20of=20the=20field=20being=20validated.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/controllers/API/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/controllers/API/index.ts b/src/frontend/src/controllers/API/index.ts index 81c5f2645..6b2517c83 100644 --- a/src/frontend/src/controllers/API/index.ts +++ b/src/frontend/src/controllers/API/index.ts @@ -52,16 +52,18 @@ export async function postValidateCode( /** * Checks the prompt for the code block by sending it to an API endpoint. - * + * @param {string} name - The name of the field to check. * @param {string} template - The template string of the prompt to check. * @param {APIClassType} frontend_node - The frontend node to check. * @returns {Promise>} A promise that resolves to an AxiosResponse containing the validation results. */ export async function postValidatePrompt( + name: string, template: string, frontend_node: APIClassType ): Promise> { return await axios.post("/api/v1/validate/prompt", { + name: name, template: template, frontend_node: frontend_node, });