ФУНКЦИИ - МЕЖПРОЕКТНАЯ КОММУНИКАЦИЯ: отправка во внешний контур и source-side список
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* Copyright (c) 2023-present Plane Software, Inc. and contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
import { API_BASE_URL } from "@plane/constants";
|
||||
import type { TExternalContourRequest, TExternalContourRequestResponse, TIssue } from "@plane/types";
|
||||
import { APIService } from "@/services/api.service";
|
||||
|
||||
export class ExternalContourService extends APIService {
|
||||
constructor() {
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async list(workspaceSlug: string, projectId: string): Promise<TExternalContourRequestResponse> {
|
||||
return this.get(`/api/workspaces/${workspaceSlug}/projects/${projectId}/external-contours/`)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async retrieve(workspaceSlug: string, projectId: string, requestId: string): Promise<TExternalContourRequest> {
|
||||
return this.get(`/api/workspaces/${workspaceSlug}/projects/${projectId}/external-contours/${requestId}/`)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async create(
|
||||
workspaceSlug: string,
|
||||
projectId: string,
|
||||
data: Partial<TIssue> & { target_project_id?: string | null }
|
||||
): Promise<TExternalContourRequest> {
|
||||
return this.post(`/api/workspaces/${workspaceSlug}/projects/${projectId}/external-contours/`, {
|
||||
target_project_id: data.target_project_id,
|
||||
issue: {
|
||||
name: data.name,
|
||||
description_html: data.description_html,
|
||||
priority: data.priority,
|
||||
assignee_ids: data.assignee_ids,
|
||||
label_ids: data.label_ids,
|
||||
target_date: data.target_date || null,
|
||||
},
|
||||
})
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./external-contour.service";
|
||||
Reference in New Issue
Block a user