Skip to content

Commit 9a7a294

Browse files
committed
♻️ Refactoring
(#2020)
1 parent 3072e64 commit 9a7a294

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/lib/services/workbooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export async function createWorkBook(workBook: WorkBook): Promise<void> {
9797
}
9898

9999
async function isExistingUrlSlug(slug: string): Promise<boolean> {
100-
return (await getWorkBookByUrlSlug(slug)) ? true : false;
100+
return !!(await getWorkBookByUrlSlug(slug));
101101
}
102102

103103
async function isExistingWorkBook(workBookId: number): Promise<boolean> {

src/lib/utils/workbook.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export async function getWorkbookWithAuthor(
3535

3636
// Validate if the author of the workbook exists after the workbook has been created.
3737
const workbookAuthor = await userCrud.getUserById(workBook.authorId);
38-
const isExistingAuthor = workbookAuthor ? true : false;
38+
const isExistingAuthor = !!workbookAuthor;
3939

4040
return { workBook: workBook, isExistingAuthor: isExistingAuthor };
4141
}

0 commit comments

Comments
 (0)