[FED-1147] chore: module link mobx integration (#2990)

* chore: link type updated

* chore: mobx implementation for module link

* chore: update module mutation logic updated and toast alert added
This commit is contained in:
Anmol Singh Bhatia 2023-12-05 19:32:25 +05:30 committed by sriram veeraghanta
parent a4d7b2423e
commit a035cee165
9 changed files with 219 additions and 93 deletions

View file

@ -1,7 +1,7 @@
// services
import { APIService } from "services/api.service";
// types
import type { IModule, IIssue, IUser } from "types";
import type { IModule, IIssue, ILinkDetails } from "types";
import { IIssueResponse } from "store/issues/types";
import { API_BASE_URL } from "helpers/common.helper";
@ -132,12 +132,8 @@ export class ModuleService extends APIService {
workspaceSlug: string,
projectId: string,
moduleId: string,
data: {
metadata: any;
title: string;
url: string;
}
): Promise<any> {
data: Partial<ILinkDetails>
): Promise<ILinkDetails> {
return this.post(`/api/workspaces/${workspaceSlug}/projects/${projectId}/modules/${moduleId}/module-links/`, data)
.then((response) => response?.data)
.catch((error) => {
@ -150,12 +146,8 @@ export class ModuleService extends APIService {
projectId: string,
moduleId: string,
linkId: string,
data: {
metadata: any;
title: string;
url: string;
}
): Promise<any> {
data: Partial<ILinkDetails>
): Promise<ILinkDetails> {
return this.patch(
`/api/workspaces/${workspaceSlug}/projects/${projectId}/modules/${moduleId}/module-links/${linkId}/`,
data