-
Notifications
You must be signed in to change notification settings - Fork 95
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
Remove deleted drafts from Recently Viewed #102
Conversation
}); | ||
|
||
// Wait for document to be deleted. | ||
yield wait(2000); |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😅
declare module "@ember/service" { | ||
interface Registry { | ||
"recently-viewed-docs": RecentlyViewedDocsService; | ||
} |
There was a problem hiding this comment.
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;
* Remove deleted drafts from RecentlyViewedDocs * Remove consoleLog * Remove `remove` :) * Update error * Enqueue the markViewed task * Update documentation
Adds a
fetchAll
call to thedeleteDraft
task to effectively remove it from the RecentlyViewedDocs list.Plus some cleanup and boilerplate.