🐛 fix(API/index.ts): add frontend_node parameter to checkPrompt function to fix validation errors
The checkPrompt function was not properly validating prompts due to missing frontend_node parameter. The fix adds the frontend_node parameter to the function and passes it to the axios.post request.
This commit is contained in:
parent
d1a58397da
commit
c0b1a12766
1 changed files with 7 additions and 2 deletions
|
|
@ -4,6 +4,7 @@ import {
|
||||||
errorsTypeAPI,
|
errorsTypeAPI,
|
||||||
InitTypeAPI,
|
InitTypeAPI,
|
||||||
UploadFileTypeAPI,
|
UploadFileTypeAPI,
|
||||||
|
APIClassType,
|
||||||
} from "./../../types/api/index";
|
} from "./../../types/api/index";
|
||||||
import { APIObjectType, sendAllProps } from "../../types/api/index";
|
import { APIObjectType, sendAllProps } from "../../types/api/index";
|
||||||
import axios, { AxiosResponse } from "axios";
|
import axios, { AxiosResponse } from "axios";
|
||||||
|
|
@ -56,9 +57,13 @@ export async function postValidateCode(
|
||||||
* @returns {Promise<AxiosResponse<PromptTypeAPI>>} A promise that resolves to an AxiosResponse containing the validation results.
|
* @returns {Promise<AxiosResponse<PromptTypeAPI>>} A promise that resolves to an AxiosResponse containing the validation results.
|
||||||
*/
|
*/
|
||||||
export async function checkPrompt(
|
export async function checkPrompt(
|
||||||
template: string
|
template: string,
|
||||||
|
frontend_node: APIClassType
|
||||||
): Promise<AxiosResponse<PromptTypeAPI>> {
|
): Promise<AxiosResponse<PromptTypeAPI>> {
|
||||||
return await axios.post("/api/v1/validate/prompt", { template });
|
return await axios.post("/api/v1/validate/prompt", {
|
||||||
|
template: template,
|
||||||
|
frontend_node: frontend_node,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue