mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: cycle type and services updated
This commit is contained in:
parent
d480325829
commit
443c9300dd
@ -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<any> {
|
||||
async getCurrentAndUpcomingCycles(workspaceSlug: string, projectId: string): Promise<CurrentAndUpcomingCyclesResponse> {
|
||||
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<any> {
|
||||
async getCompletedCycles(workspaceSlug: string, projectId: string): Promise<CompletedCyclesResponse> {
|
||||
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) => {
|
||||
|
12
apps/app/types/cycles.d.ts
vendored
12
apps/app/types/cycles.d.ts
vendored
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user