chore: issue link mobx integration (#3072)
* chore: issue link mobx integration * chore: issue link code refactor and build fix
This commit is contained in:
parent
f119d702c7
commit
c33cfeb227
9 changed files with 172 additions and 199 deletions
|
|
@ -1,7 +1,7 @@
|
|||
// services
|
||||
import { APIService } from "services/api.service";
|
||||
// type
|
||||
import type { IUser, IIssue, IIssueActivity, ISubIssueResponse, IIssueDisplayProperties } from "types";
|
||||
import type { IIssue, IIssueActivity, ISubIssueResponse, IIssueDisplayProperties, ILinkDetails, IIssueLink } from "types";
|
||||
import { IIssueResponse } from "store/issues/types";
|
||||
// helper
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
|
|
@ -184,12 +184,8 @@ export class IssueService extends APIService {
|
|||
workspaceSlug: string,
|
||||
projectId: string,
|
||||
issueId: string,
|
||||
data: {
|
||||
metadata: any;
|
||||
title: string;
|
||||
url: string;
|
||||
}
|
||||
): Promise<any> {
|
||||
data: IIssueLink
|
||||
): Promise<ILinkDetails> {
|
||||
return this.post(`/api/workspaces/${workspaceSlug}/projects/${projectId}/issues/${issueId}/issue-links/`, data)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
|
|
@ -202,12 +198,8 @@ export class IssueService extends APIService {
|
|||
projectId: string,
|
||||
issueId: string,
|
||||
linkId: string,
|
||||
data: {
|
||||
metadata: any;
|
||||
title: string;
|
||||
url: string;
|
||||
}
|
||||
): Promise<any> {
|
||||
data: IIssueLink
|
||||
): Promise<ILinkDetails> {
|
||||
return this.patch(
|
||||
`/api/workspaces/${workspaceSlug}/projects/${projectId}/issues/${issueId}/issue-links/${linkId}/`,
|
||||
data
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// services
|
||||
import { APIService } from "services/api.service";
|
||||
// types
|
||||
import type { IModule, IIssue, ILinkDetails } from "types";
|
||||
import type { IModule, IIssue, ILinkDetails, ModuleLink } from "types";
|
||||
import { IIssueResponse } from "store/issues/types";
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ export class ModuleService extends APIService {
|
|||
workspaceSlug: string,
|
||||
projectId: string,
|
||||
moduleId: string,
|
||||
data: Partial<ILinkDetails>
|
||||
data: ModuleLink
|
||||
): Promise<ILinkDetails> {
|
||||
return this.post(`/api/workspaces/${workspaceSlug}/projects/${projectId}/modules/${moduleId}/module-links/`, data)
|
||||
.then((response) => response?.data)
|
||||
|
|
@ -146,7 +146,7 @@ export class ModuleService extends APIService {
|
|||
projectId: string,
|
||||
moduleId: string,
|
||||
linkId: string,
|
||||
data: Partial<ILinkDetails>
|
||||
data: ModuleLink
|
||||
): Promise<ILinkDetails> {
|
||||
return this.patch(
|
||||
`/api/workspaces/${workspaceSlug}/projects/${projectId}/modules/${moduleId}/module-links/${linkId}/`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue