Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deleted drafts from Recently Viewed #102

Merged
merged 6 commits into from
Mar 23, 2023

Conversation

jeffdaley
Copy link
Contributor

@jeffdaley jeffdaley commented Mar 23, 2023

Adds a fetchAll call to the deleteDraft task to effectively remove it from the RecentlyViewedDocs list.

Plus some cleanup and boilerplate.

});

// Wait for document to be deleted.
yield wait(2000);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to wait for this since we're redirecting to a known route (unlike the new doc form).

method: "DELETE",
headers: { "Content-Type": "application/json" },
})
.then((resp) => resp.json())
Copy link
Contributor Author

@jeffdaley jeffdaley Mar 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look like we're doing anything with the JSON. I've removed this call in TS version

@@ -146,8 +146,6 @@ export default function (mirageConfig) {
* Used by the Document route to get a document.
*/
this.get("/documents/:document_id", (schema, request) => {
debugger;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😅

Comment on lines +312 to +315
declare module "@ember/service" {
interface Registry {
"recently-viewed-docs": RecentlyViewedDocsService;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to allow aliasing in TS files, e.g., @service('recently-viewed-docs') declare recentDocs;

@jeffdaley jeffdaley marked this pull request as ready for review March 23, 2023 19:48
@jeffdaley jeffdaley requested a review from a team as a code owner March 23, 2023 19:48
@jeffdaley jeffdaley merged commit 89341c9 into main Mar 23, 2023
@jeffdaley jeffdaley deleted the jeffdaley/remove-deleted-docs-from-recently-viewed branch March 23, 2023 22:40
anuragprafulla pushed a commit to razorpay/hermes that referenced this pull request Jun 27, 2023
* Remove deleted drafts from RecentlyViewedDocs

* Remove consoleLog

* Remove `remove` :)

* Update error

* Enqueue the markViewed task

* Update documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants