From 443c9300ddeb236cca6bf29e773ee795fab3e476 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Tue, 28 Feb 2023 14:47:32 +0530 Subject: [PATCH] chore: cycle type and services updated --- apps/app/services/cycles.service.ts | 8 ++++---- apps/app/types/cycles.d.ts | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/apps/app/services/cycles.service.ts b/apps/app/services/cycles.service.ts index fa9769dc8..42f2f21ae 100644 --- a/apps/app/services/cycles.service.ts +++ b/apps/app/services/cycles.service.ts @@ -1,7 +1,7 @@ // services import APIService from "services/api.service"; // types -import type { ICycle } from "types"; +import type { CompletedCyclesResponse, CurrentAndUpcomingCyclesResponse, ICycle } from "types"; const { NEXT_PUBLIC_API_BASE_URL } = process.env; @@ -99,7 +99,7 @@ class ProjectCycleServices extends APIService { }); } - async getCurrentAndUpcomingCycles(workspaceSlug: string, projectId: string): Promise { + async getCurrentAndUpcomingCycles(workspaceSlug: string, projectId: string): Promise { return this.get( `/api/workspaces/${workspaceSlug}/projects/${projectId}/cycles/current-upcoming-cycles/` ) @@ -109,9 +109,9 @@ class ProjectCycleServices extends APIService { }); } - async getCompletedCycles(workspaceSlug: string, projectId: string): Promise { + async getCompletedCycles(workspaceSlug: string, projectId: string): Promise { return this.get( - `/api/workspaces/${workspaceSlug}/projects/${projectId}/cycles/past-cycles/` + `/api/workspaces/${workspaceSlug}/projects/${projectId}/cycles/completed-cycles/` ) .then((response) => response?.data) .catch((error) => { diff --git a/apps/app/types/cycles.d.ts b/apps/app/types/cycles.d.ts index dbd7573bf..060fe53f3 100644 --- a/apps/app/types/cycles.d.ts +++ b/apps/app/types/cycles.d.ts @@ -15,8 +15,20 @@ export interface ICycle { project: string; workspace: string; issue: string; + current_cycle: []; + upcoming_cycle: []; + past_cycles: []; } +export interface CurrentAndUpcomingCyclesResponse { + current_cycle : ICycle[]; + upcoming_cycle : ICycle[]; +} + +export interface CompletedCyclesResponse { + completed_cycles : ICycle[]; + } + export interface CycleIssueResponse { id: string; issue_detail: IIssue;