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:
parent
9309d1b574
commit
eed2ca77ef
9 changed files with 90 additions and 16 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue