support for backend jobs and other script API changes

This commit is contained in:
azivner
2018-02-24 14:42:52 -05:00
parent 5dd93e4cdc
commit a555b6319c
8 changed files with 106 additions and 11 deletions

View File

@@ -29,7 +29,7 @@ async function getNoteStartingWith(parentNoteId, startsWith) {
AND note_tree.isDeleted = 0`, [parentNoteId]);
}
async function getRootNoteId() {
async function getRootCalendarNoteId() {
let rootNoteId = await sql.getValue(`SELECT notes.noteId FROM notes JOIN attributes USING(noteId)
WHERE attributes.name = '${CALENDAR_ROOT_ATTRIBUTE}' AND notes.isDeleted = 0`);
@@ -91,7 +91,7 @@ async function getMonthNoteId(dateTimeStr, rootNoteId) {
async function getDateNoteId(dateTimeStr, rootNoteId = null) {
if (!rootNoteId) {
rootNoteId = await getRootNoteId();
rootNoteId = await getRootCalendarNoteId();
}
const dateStr = dateTimeStr.substr(0, 10);
@@ -119,7 +119,7 @@ async function getDateNoteId(dateTimeStr, rootNoteId = null) {
}
module.exports = {
getRootNoteId,
getRootCalendarNoteId,
getYearNoteId,
getMonthNoteId,
getDateNoteId