diff --git a/src/public/app/services/date_notes.ts b/src/public/app/services/date_notes.ts index 8dad0bf37..013b900f7 100644 --- a/src/public/app/services/date_notes.ts +++ b/src/public/app/services/date_notes.ts @@ -23,13 +23,21 @@ async function getDayNote(date: string) { } async function getWeekFirstDayNote(date: string) { - const note = await server.get(`special-notes/weeks/${date}`, "date-note"); + const note = await server.get(`special-notes/week-first-day/${date}`, "date-note"); await ws.waitForMaxKnownEntityChangeId(); return await froca.getNote(note.noteId); } +async function getWeekNote(week: string) { + const note = await server.get(`special-notes/weeks/${week}`, "date-note"); + + await ws.waitForMaxKnownEntityChangeId(); + + return await froca.getNote(note?.noteId); +} + async function getMonthNote(month: string) { const note = await server.get(`special-notes/months/${month}`, "date-note"); @@ -67,6 +75,7 @@ export default { getTodayNote, getDayNote, getWeekFirstDayNote, + getWeekNote, getMonthNote, getYearNote, createSqlConsole, diff --git a/src/routes/routes.ts b/src/routes/routes.ts index a7a0601de..4a18ad87c 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -1,5 +1,3 @@ -"use strict"; - import { isElectron, safeExtractMessageAndStackFromError } from "../services/utils.js"; import multer from "multer"; import log from "../services/log.js"; @@ -307,7 +305,8 @@ function register(app: express.Application) { apiRoute(GET, "/api/special-notes/inbox/:date", specialNotesRoute.getInboxNote); apiRoute(GET, "/api/special-notes/days/:date", specialNotesRoute.getDayNote); - apiRoute(GET, "/api/special-notes/weeks/:date", specialNotesRoute.getWeekFirstDayNote); + apiRoute(GET, "/api/special-notes/week-first-day/:date", specialNotesRoute.getWeekFirstDayNote); + apiRoute(GET, "/api/special-notes/weeks/:week", specialNotesRoute.getWeekNote); apiRoute(GET, "/api/special-notes/months/:month", specialNotesRoute.getMonthNote); apiRoute(GET, "/api/special-notes/years/:year", specialNotesRoute.getYearNote); apiRoute(GET, "/api/special-notes/notes-for-month/:month", specialNotesRoute.getDayNotesForMonth);