From d381228b83bcd09834eee5ffa3293e38952bbbbe Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 12 Jun 2023 17:03:54 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20feat(API):=20add=20BuildStatusTy?= =?UTF-8?q?peAPI=20to=20API=20types=20and=20implement=20getBuildStatus=20f?= =?UTF-8?q?unction=20The=20BuildStatusTypeAPI=20was=20added=20to=20the=20A?= =?UTF-8?q?PI=20types=20to=20support=20the=20new=20getBuildStatus=20functi?= =?UTF-8?q?on.=20The=20getBuildStatus=20function=20retrieves=20the=20build?= =?UTF-8?q?=20status=20of=20a=20flow=20by=20making=20a=20GET=20request=20t?= =?UTF-8?q?o=20the=20server.=20This=20function=20is=20useful=20for=20updat?= =?UTF-8?q?ing=20the=20UI=20with=20the=20current=20status=20of=20a=20flow.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/controllers/API/index.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/controllers/API/index.ts b/src/frontend/src/controllers/API/index.ts index 53480ae61..2b8a4ed85 100644 --- a/src/frontend/src/controllers/API/index.ts +++ b/src/frontend/src/controllers/API/index.ts @@ -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 axios, { AxiosResponse } from "axios"; import { FlowType } from "../../types/flow"; @@ -40,6 +44,8 @@ export async function getExamples(): Promise { return await Promise.all(contentsPromises); } -export async function postBuild(flow: FlowType) { - return await axios.post(`/build/${flow.id}`, flow); +export async function getBuildStatus( + flowId: string +): Promise { + return await axios.get(`/build/${flowId}/status`); }