chore: More typescript FIXME's removed

This commit is contained in:
Tom Moor
2022-01-06 21:25:42 -08:00
parent 8d05c752ea
commit c6cc04cad8
58 changed files with 199 additions and 221 deletions

View File

@@ -257,8 +257,7 @@ export default class DocumentsStore extends BaseStore<Document> {
this.backlinks.set(
documentId,
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'doc' implicitly has an 'any' type.
data.map((doc) => doc.id)
data.map((doc: Partial<Document>) => doc.id)
);
});
};
@@ -401,15 +400,13 @@ export default class DocumentsStore extends BaseStore<Document> {
invariant(res && res.data, "Search response should be available");
// add the documents and associated policies to the store
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'result' implicitly has an 'any' type.
res.data.forEach((result) => this.add(result.document));
res.data.forEach((result: SearchResult) => this.add(result.document));
this.addPolicies(res.policies);
// store a reference to the document model in the search cache instead
// of the original result from the API.
const results: SearchResult[] = compact(
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'result' implicitly has an 'any' type.
res.data.map((result) => {
res.data.map((result: SearchResult) => {
const document = this.data.get(result.document.id);
if (!document) return null;
return {