🚀 feat(API): add BuildStatusTypeAPI to API types and implement getBuildStatus function
The BuildStatusTypeAPI was added to the API types to support the new getBuildStatus function. The getBuildStatus function retrieves the build status of a flow by making a GET request to the server. This function is useful for updating the UI with the current status of a flow.
This commit is contained in:
parent
68e17384c8
commit
d381228b83
1 changed files with 9 additions and 3 deletions
|
|
@ -1,4 +1,8 @@
|
||||||
import { PromptTypeAPI, errorsTypeAPI } from "./../../types/api/index";
|
import {
|
||||||
|
BuildStatusTypeAPI,
|
||||||
|
PromptTypeAPI,
|
||||||
|
errorsTypeAPI,
|
||||||
|
} 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";
|
||||||
import { FlowType } from "../../types/flow";
|
import { FlowType } from "../../types/flow";
|
||||||
|
|
@ -40,6 +44,8 @@ export async function getExamples(): Promise<FlowType[]> {
|
||||||
return await Promise.all(contentsPromises);
|
return await Promise.all(contentsPromises);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function postBuild(flow: FlowType) {
|
export async function getBuildStatus(
|
||||||
return await axios.post(`/build/${flow.id}`, flow);
|
flowId: string
|
||||||
|
): Promise<BuildStatusTypeAPI> {
|
||||||
|
return await axios.get(`/build/${flowId}/status`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue