fix: added workspaceslug in renderChildren of project settings (#5951)

* fix: added workspaceslug in renderChildren of project settings

* fix: updated apis

* fix: types

* fix: added editor

* fix: handled avatar for intake
This commit is contained in:
Akshita Goyal 2024-11-05 16:07:27 +05:30 committed by GitHub
parent 9309d1b574
commit eed2ca77ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 90 additions and 16 deletions

View file

@ -71,7 +71,7 @@ export interface IProjectInboxStore {
fetchInboxPaginationIssues: (workspaceSlug: string, projectId: string) => Promise<void>;
fetchInboxIssueById: (workspaceSlug: string, projectId: string, inboxIssueId: string) => Promise<TInboxIssue>;
fetchIntakeForms: (workspaceSlug: string, projectId: string) => Promise<void>;
toggleIntakeForms: (workspaceSlug: string, projectId: string, isDisabled: boolean) => Promise<void>;
toggleIntakeForms: (workspaceSlug: string, projectId: string, data: Partial<TInboxForm>) => Promise<void>;
regenerateIntakeForms: (workspaceSlug: string, projectId: string) => Promise<void>;
createInboxIssue: (
workspaceSlug: string,
@ -329,20 +329,23 @@ export class ProjectInboxStore implements IProjectInboxStore {
}
};
toggleIntakeForms = async (workspaceSlug: string, projectId: string, isDisabled: boolean) => {
toggleIntakeForms = async (workspaceSlug: string, projectId: string, data: Partial<TInboxForm>) => {
const initialData = this.intakeForms[projectId];
try {
runInAction(() => {
set(this.intakeForms, projectId, { ...this.intakeForms[projectId], is_disabled: isDisabled });
set(this.intakeForms, projectId, { ...this.intakeForms[projectId], ...data });
});
const result = await this.inboxIssueService.updatePublishForm(workspaceSlug, projectId, data);
runInAction(() => {
set(this.intakeForms, projectId, { ...this.intakeForms[projectId], anchor: result?.anchor });
});
await this.inboxIssueService.updatePublishForm(workspaceSlug, projectId, isDisabled);
} catch {
console.error("Error fetching the publish forms");
runInAction(() => {
set(this.intakeForms, projectId, { ...this.intakeForms[projectId], is_disabled: !isDisabled });
set(this.intakeForms, projectId, initialData);
});
}
};
regenerateIntakeForms = async (workspaceSlug: string, projectId: string) => {
try {
const form = await this.inboxIssueService.regeneratePublishForm(workspaceSlug, projectId);