From ef5623e1b386a69fbff3e11dedeee23679777d8d Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 15 Jun 2023 07:43:53 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20docs(API):=20add=20documentation?= =?UTF-8?q?=20for=20postBuildInit=20function=20=E2=9C=A8=20feat(API):=20ad?= =?UTF-8?q?d=20postBuildInit=20function=20to=20post=20the=20build=20init?= =?UTF-8?q?=20of=20a=20flow=20The=20postBuildInit=20function=20has=20been?= =?UTF-8?q?=20added=20to=20post=20the=20build=20init=20of=20a=20flow.=20Th?= =?UTF-8?q?e=20function=20takes=20in=20a=20flow=20object=20and=20returns?= =?UTF-8?q?=20a=20promise=20that=20resolves=20to=20an=20AxiosResponse=20co?= =?UTF-8?q?ntaining=20the=20build=20status.=20Documentation=20has=20been?= =?UTF-8?q?=20added=20to=20the=20function=20to=20improve=20code=20readabil?= =?UTF-8?q?ity=20and=20maintainability.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/controllers/API/index.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/frontend/src/controllers/API/index.ts b/src/frontend/src/controllers/API/index.ts index 169f63d31..b2d21bffd 100644 --- a/src/frontend/src/controllers/API/index.ts +++ b/src/frontend/src/controllers/API/index.ts @@ -277,12 +277,27 @@ export async function getVersion() { */ export async function getHealth() { return await axios.get("/health"); // Health is the only endpoint that doesn't require /api/v1 +} + +/** + * Fetches the build status of a flow. + * @param {string} flowId - The ID of the flow to fetch the build status for. + * @returns {Promise} A promise that resolves to an AxiosResponse containing the build status. + * + */ export async function getBuildStatus( flowId: string ): Promise { return await axios.get(`/api/v1/build/${flowId}/status`); } +//docs for postbuildinit +/** + * Posts the build init of a flow. + * @param {string} flowId - The ID of the flow to fetch the build status for. + * @returns {Promise} A promise that resolves to an AxiosResponse containing the build status. + * + */ export async function postBuildInit( flow: FlowType ): Promise> {