fix: intake loading (#5966)
* fix: intake loading * fix: image upload in space
This commit is contained in:
parent
1d314dd25f
commit
0cd36b854e
4 changed files with 16 additions and 3 deletions
|
|
@ -253,7 +253,7 @@ export class IssueDetailStore implements IIssueDetailStore {
|
|||
anchor,
|
||||
{
|
||||
entity_identifier: commentID ?? "",
|
||||
entity_type: EFileAssetType.ISSUE_ATTACHMENT,
|
||||
entity_type: EFileAssetType.ISSUE_DESCRIPTION,
|
||||
},
|
||||
file
|
||||
);
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ export class InboxIssueService extends APIService {
|
|||
});
|
||||
}
|
||||
|
||||
async regeneratePublishForm(workspaceSlug: string, projectId: string): Promise<TInboxIssue> {
|
||||
async regeneratePublishForm(workspaceSlug: string, projectId: string): Promise<TInboxForm> {
|
||||
return this.post(`/api/workspaces/${workspaceSlug}/projects/${projectId}/publish-intake-regenerate/`)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
|
|
|
|||
|
|
@ -351,7 +351,10 @@ export class ProjectInboxStore implements IProjectInboxStore {
|
|||
const form = await this.inboxIssueService.regeneratePublishForm(workspaceSlug, projectId);
|
||||
if (form) {
|
||||
runInAction(() => {
|
||||
set(this.intakeForms, projectId, form);
|
||||
set(this.intakeForms, projectId, {
|
||||
...this.intakeForms[projectId],
|
||||
anchor: form?.anchor,
|
||||
});
|
||||
});
|
||||
}
|
||||
} catch {
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import { CoreRootStore } from "../root.store";
|
|||
|
||||
export interface IProjectStore {
|
||||
// observables
|
||||
isUpdatingProject: boolean;
|
||||
loader: boolean;
|
||||
projectMap: {
|
||||
[projectId: string]: TProject; // projectId: project Info
|
||||
|
|
@ -47,6 +48,7 @@ export interface IProjectStore {
|
|||
|
||||
export class ProjectStore implements IProjectStore {
|
||||
// observables
|
||||
isUpdatingProject: boolean = false;
|
||||
loader: boolean = false;
|
||||
projectMap: {
|
||||
[projectId: string]: TProject; // projectId: project Info
|
||||
|
|
@ -63,6 +65,7 @@ export class ProjectStore implements IProjectStore {
|
|||
constructor(_rootStore: CoreRootStore) {
|
||||
makeObservable(this, {
|
||||
// observables
|
||||
isUpdatingProject: observable,
|
||||
loader: observable.ref,
|
||||
projectMap: observable,
|
||||
// computed
|
||||
|
|
@ -380,13 +383,20 @@ export class ProjectStore implements IProjectStore {
|
|||
const projectDetails = this.getProjectById(projectId);
|
||||
runInAction(() => {
|
||||
set(this.projectMap, [projectId], { ...projectDetails, ...data });
|
||||
this.isUpdatingProject = true;
|
||||
});
|
||||
const response = await this.projectService.updateProject(workspaceSlug, projectId, data);
|
||||
runInAction(() => {
|
||||
this.isUpdatingProject = false;
|
||||
});
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.log("Failed to create project from project store");
|
||||
this.fetchProjects(workspaceSlug);
|
||||
this.fetchProjectDetails(workspaceSlug, projectId);
|
||||
runInAction(() => {
|
||||
this.isUpdatingProject = false;
|
||||
});
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue