Skip to content

Commit

Permalink
refactor: remove date-fns
Browse files Browse the repository at this point in the history
We do not need it
  • Loading branch information
aalemayhu committed Oct 17, 2024
1 parent a4fa7ab commit 35d591b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
10 changes: 0 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"cheerio": "^1.0.0-rc.12",
"cookie-parser": "^1.4.6",
"crypto-js": "^4.2.0",
"date-fns": "^4.1.0",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"fflate": "^0.8.0",
Expand Down
3 changes: 1 addition & 2 deletions src/services/NotionService/helpers/getBlockCache.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ListBlockChildrenResponse } from '@notionhq/client/build/src/api-endpoints';
import isAfter from 'date-fns/isAfter';
import { Knex } from 'knex';

import Blocks from '../../../data_layer/public/Blocks';
Expand All @@ -21,7 +20,7 @@ export async function getBlockCache({
.where({ object_id: id, owner })
.first();
// We did not find a cache entry or the user has made changes
if (!cache || isAfter(new Date(lastEditedAt), cache.last_edited_time)) {
if (!cache || new Date(lastEditedAt) > new Date(cache.last_edited_time)) {
return undefined;
}
// Found cache and update the fetch request (used for performance analysis)
Expand Down

0 comments on commit 35d591b

Please sign in to comment.