diff --git a/src/routes/content.js b/src/routes/content.js index 4aad4d5..d16bc11 100644 --- a/src/routes/content.js +++ b/src/routes/content.js @@ -11,6 +11,7 @@ import { importNotionCvs } from "../objects/cv.js"; import { importFiles } from "../objects/files.js"; import { importNotionProjects } from "../objects/projects.js"; import { importVideos } from "../objects/videos.js"; +import { handleBlurhashUpdate } from "../utils/imageCache"; // Fetch or return cached content export async function getCachedContent(env, request) { @@ -43,6 +44,7 @@ export async function getCachedContent(env, request) { cachedContent.images = await importImages(env); cachedContent.files = await importFiles(env); cachedContent.videos = await importVideos(env); + await handleBlurhashUpdate(request, env); } if (noPages) { @@ -50,6 +52,7 @@ export async function getCachedContent(env, request) { cachedContent.images = await importImages(env); cachedContent.files = await importFiles(env); cachedContent.videos = await importVideos(env); + await handleBlurhashUpdate(request, env); } if (noCvs) { @@ -63,6 +66,7 @@ export async function getCachedContent(env, request) { cachedContent.images = await importImages(env); cachedContent.files = await importFiles(env); cachedContent.videos = await importVideos(env); + await handleBlurhashUpdate(request, env); } if (noProjects) { diff --git a/src/routes/hooks.js b/src/routes/hooks.js index 55f4519..2b1671d 100644 --- a/src/routes/hooks.js +++ b/src/routes/hooks.js @@ -6,10 +6,20 @@ import { globalHeaders } from "../utils/api"; import { importImages } from "../objects/images"; import { importFiles } from "../objects/files"; import { importVideos } from "../objects/videos"; -import { importNotionProjects } from "../objects/projects"; -import { importNotionCompanies } from "../objects/companies"; -import { importNotionPositions } from "../objects/positions"; -import { importNotionCvs } from "../objects/cv"; +import { handleBlurhashUpdate } from "../utils/imageCache"; +import { + importNotionProjects, + deleteNotionProjectFromCache, +} from "../objects/projects"; +import { + importNotionCompanies, + deleteNotionCompanyFromCache, +} from "../objects/companies"; +import { + importNotionPositions, + deleteNotionPositionFromCache, +} from "../objects/positions"; +import { importNotionCvs, deleteNotionCvFromCache } from "../objects/cv"; async function updateAllNotionData(env) { await importNotionNavigation(env); diff --git a/tb-api.paw b/tb-api.paw index 1d06168..649371d 100644 Binary files a/tb-api.paw and b/tb-api.paw differ