chore: Enable eslint to enforce curly (#3060)

This commit is contained in:
Tom Moor
2022-02-05 10:15:40 -08:00
committed by GitHub
parent c7df74fcc4
commit c5a11fe17b
103 changed files with 1175 additions and 397 deletions

View File

@@ -186,7 +186,9 @@ class Collection extends ParanoidModel {
// getters
get url(): string {
if (!this.name) return `/collection/untitled-${this.urlId}`;
if (!this.name) {
return `/collection/untitled-${this.urlId}`;
}
return `/collection/${slugify(this.name)}-${this.urlId}`;
}
@@ -354,7 +356,9 @@ class Collection extends ParanoidModel {
}
getDocumentTree = (documentId: string): NavigationNode | null => {
if (!this.documentStructure) return null;
if (!this.documentStructure) {
return null;
}
const sort: Sort = this.sort || {
field: "title",
direction: "asc",
@@ -386,7 +390,9 @@ class Collection extends ParanoidModel {
loopChildren(this.documentStructure);
// if the document is a draft loopChildren will not find it in the structure
if (!result) return null;
if (!result) {
return null;
}
return {
...result,
@@ -548,7 +554,9 @@ class Collection extends ParanoidModel {
* Update document's title and url in the documentStructure
*/
updateDocument = async function (updatedDocument: Document) {
if (!this.documentStructure) return;
if (!this.documentStructure) {
return;
}
let transaction;
try {