fix: issue peek-overview delete functionality (#3134)

* fix: peek-overview delete issue

* refactor: removed unused variables
This commit is contained in:
Lakhan Baheti 2023-12-18 12:14:57 +05:30 committed by GitHub
parent 969a51f425
commit 05e7afab8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 172 additions and 35 deletions

View file

@ -82,7 +82,7 @@ const PageDetailsPage: NextPageWithLayout = observer(() => {
description_html: newDescription,
})
.then(() => {
mutatePageDetails((prevData) => ({ ...prevData, description_html: newDescription }) as IPage, false);
mutatePageDetails((prevData) => ({ ...prevData, description_html: newDescription } as IPage), false);
});
};
@ -162,15 +162,12 @@ const PageDetailsPage: NextPageWithLayout = observer(() => {
}, [pageDetails?.description_html]); // TODO: Verify the exhaustive-deps warning
function createObjectFromArray(keys: string[], options: any): any {
return keys.reduce(
(obj, key) => {
if (options[key] !== undefined) {
obj[key] = options[key];
}
return obj;
},
{} as { [key: string]: any }
);
return keys.reduce((obj, key) => {
if (options[key] !== undefined) {
obj[key] = options[key];
}
return obj;
}, {} as { [key: string]: any });
}
const mutatePageDetailsHelper = (
@ -499,7 +496,7 @@ const PageDetailsPage: NextPageWithLayout = observer(() => {
projectId={projectId as string}
issueId={peekIssueId ? (peekIssueId as string) : ""}
isArchived={false}
handleIssue={(issueToUpdate) => {
handleIssue={async (issueToUpdate, action) => {
if (peekIssueId && typeof peekIssueId === "string") {
handleUpdateIssue(peekIssueId, issueToUpdate);
}