diff --git a/docs/frontend_api/FrontendScriptApi.html b/docs/frontend_api/FrontendScriptApi.html index cc2b9f1a1..6114b21a1 100644 --- a/docs/frontend_api/FrontendScriptApi.html +++ b/docs/frontend_api/FrontendScriptApi.html @@ -4680,7 +4680,7 @@ otherwise (by e.g. createLink()) -

getWeekNote(date) → {Promise.<FNote>}

+

getWeekFirstDayNote(date) → {Promise.<FNote>}

diff --git a/docs/frontend_api/services_frontend_script_api.js.html b/docs/frontend_api/services_frontend_script_api.js.html index 53cd61c4c..bee5628fa 100644 --- a/docs/frontend_api/services_frontend_script_api.js.html +++ b/docs/frontend_api/services_frontend_script_api.js.html @@ -563,7 +563,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain * @param {string} date - e.g. "2019-04-29" * @returns {Promise<FNote>} */ - this.getWeekNote = dateNotesService.getWeekNote; + this.getWeekFirstDayNote = dateNotesService.getWeekFirstDayNote; /** * Returns month-note. If it doesn't exist, it is automatically created. diff --git a/src/etapi/etapi.openapi.yaml b/src/etapi/etapi.openapi.yaml index eed39fd80..ac2f01f55 100644 --- a/src/etapi/etapi.openapi.yaml +++ b/src/etapi/etapi.openapi.yaml @@ -694,7 +694,7 @@ paths: /calendar/weeks/{date}: get: description: returns a week note for a given date. Gets created if doesn't exist. - operationId: getWeekNote + operationId: getWeekFirstDayNote parameters: - name: date in: path diff --git a/src/etapi/special_notes.ts b/src/etapi/special_notes.ts index 23411c987..f8f5bc47c 100644 --- a/src/etapi/special_notes.ts +++ b/src/etapi/special_notes.ts @@ -46,7 +46,7 @@ function register(router: Router) { throw getDateInvalidError(date); } - const note = dateNotesService.getWeekNote(date); + const note = dateNotesService.getWeekFirstDayNote(date); res.json(mappers.mapNoteToPojo(note)); }); diff --git a/src/public/app/services/date_notes.ts b/src/public/app/services/date_notes.ts index 17aa7b963..8dad0bf37 100644 --- a/src/public/app/services/date_notes.ts +++ b/src/public/app/services/date_notes.ts @@ -22,7 +22,7 @@ async function getDayNote(date: string) { return await froca.getNote(note.noteId); } -async function getWeekNote(date: string) { +async function getWeekFirstDayNote(date: string) { const note = await server.get(`special-notes/weeks/${date}`, "date-note"); await ws.waitForMaxKnownEntityChangeId(); @@ -66,7 +66,7 @@ export default { getInboxNote, getTodayNote, getDayNote, - getWeekNote, + getWeekFirstDayNote, getMonthNote, getYearNote, createSqlConsole, diff --git a/src/public/app/services/frontend_script_api.ts b/src/public/app/services/frontend_script_api.ts index bd30a58cc..c20d9dc16 100644 --- a/src/public/app/services/frontend_script_api.ts +++ b/src/public/app/services/frontend_script_api.ts @@ -363,7 +363,7 @@ interface Api { * * @param date - e.g. "2019-04-29" */ - getWeekNote: typeof dateNotesService.getWeekNote; + getWeekFirstDayNote: typeof dateNotesService.getWeekFirstDayNote; /** * Returns month-note. If it doesn't exist, it is automatically created. @@ -651,7 +651,7 @@ function FrontendScriptApi(this: Api, startNote: FNote, currentNote: FNote, orig this.getTodayNote = dateNotesService.getTodayNote; this.getDayNote = dateNotesService.getDayNote; - this.getWeekNote = dateNotesService.getWeekNote; + this.getWeekFirstDayNote = dateNotesService.getWeekFirstDayNote; this.getMonthNote = dateNotesService.getMonthNote; this.getYearNote = dateNotesService.getYearNote; diff --git a/src/routes/api/special_notes.ts b/src/routes/api/special_notes.ts index b884c3291..2c68d3db9 100644 --- a/src/routes/api/special_notes.ts +++ b/src/routes/api/special_notes.ts @@ -15,8 +15,8 @@ function getDayNote(req: Request) { return dateNoteService.getDayNote(req.params.date); } -function getWeekNote(req: Request) { - return dateNoteService.getWeekNote(req.params.date); +function getWeekFirstDayNote(req: Request) { + return dateNoteService.getWeekFirstDayNote(req.params.date); } function getMonthNote(req: Request) { @@ -101,7 +101,7 @@ function createOrUpdateScriptLauncherFromApi(req: Request) { export default { getInboxNote, getDayNote, - getWeekNote, + getWeekFirstDayNote, getMonthNote, getYearNote, getDayNotesForMonth, diff --git a/src/routes/routes.ts b/src/routes/routes.ts index abae1acaa..a7a0601de 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -307,7 +307,7 @@ 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.getWeekNote); + apiRoute(GET, "/api/special-notes/weeks/:date", specialNotesRoute.getWeekFirstDayNote); 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); diff --git a/src/services/backend_script_api.ts b/src/services/backend_script_api.ts index 42b56033f..3d07384a7 100644 --- a/src/services/backend_script_api.ts +++ b/src/services/backend_script_api.ts @@ -239,7 +239,7 @@ interface Api { * @param date in YYYY-MM-DD format * @param rootNote - specify calendar root note, normally leave empty to use the default calendar */ - getWeekNote( + getWeekFirstDayNote( date: string, options: { // TODO: Deduplicate type with date_notes.ts once ES modules are added. @@ -552,7 +552,7 @@ function BackendScriptApi(this: Api, currentNote: BNote, apiParams: ApiParams) { this.getRootCalendarNote = dateNoteService.getRootCalendarNote; this.getDayNote = dateNoteService.getDayNote; this.getTodayNote = dateNoteService.getTodayNote; - this.getWeekNote = dateNoteService.getWeekNote; + this.getWeekFirstDayNote = dateNoteService.getWeekFirstDayNote; this.getMonthNote = dateNoteService.getMonthNote; this.getYearNote = dateNoteService.getYearNote; diff --git a/src/services/date_notes.ts b/src/services/date_notes.ts index a0292fc1e..6e64ecc53 100644 --- a/src/services/date_notes.ts +++ b/src/services/date_notes.ts @@ -12,6 +12,7 @@ import { t } from "i18next"; const CALENDAR_ROOT_LABEL = "calendarRoot"; const YEAR_LABEL = "yearNote"; const MONTH_LABEL = "monthNote"; +const WEEK_LABEL = "weekNote"; const DATE_LABEL = "dateNote"; const WEEKDAY_TRANSLATION_IDS = ["weekdays.sunday", "weekdays.monday", "weekdays.tuesday", "weekdays.wednesday", "weekdays.thursday", "weekdays.friday", "weekdays.saturday", "weekdays.sunday"]; @@ -225,7 +226,7 @@ interface WeekNoteOpts { startOfTheWeek?: StartOfWeek; } -function getWeekNote(dateStr: string, options: WeekNoteOpts = {}, rootNote: BNote | null = null) { +function getWeekFirstDayNote(dateStr: string, options: WeekNoteOpts = {}, rootNote: BNote | null = null) { const startOfTheWeek = options.startOfTheWeek || "monday"; const dateObj = getStartOfTheWeek(dateUtils.parseLocalDate(dateStr), startOfTheWeek); @@ -239,7 +240,7 @@ export default { getRootCalendarNote, getYearNote, getMonthNote, - getWeekNote, + getWeekFirstDayNote, getDayNote, getTodayNote };