🔧 chore(API/index.ts): add name parameter to postValidatePrompt function for improved code readability

The postValidatePrompt function now accepts a name parameter, which represents the name of the field to check. This change improves the code readability by explicitly specifying the name of the field being validated.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-07-03 23:12:18 -03:00
commit 67ffdcd0c7

View file

@ -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<AxiosResponse<PromptTypeAPI>>} A promise that resolves to an AxiosResponse containing the validation results.
*/
export async function postValidatePrompt(
name: string,
template: string,
frontend_node: APIClassType
): Promise<AxiosResponse<PromptTypeAPI>> {
return await axios.post("/api/v1/validate/prompt", {
name: name,
template: template,
frontend_node: frontend_node,
});