implemented new way of adding extra languages to note type picker

This commit is contained in:
zadam
2019-08-26 21:43:28 +02:00
parent 0558c30b56
commit cf5c1c1be1
3 changed files with 62 additions and 8 deletions

View File

@@ -0,0 +1,24 @@
"use strict";
const attributesService = require('../../services/attributes');
const log = require('../../services/log');
async function get() {
const notes = await attributesService.getNotesWithLabel('codeMimeTypes');
let merged = [];
for (const note of notes) {
try {
merged = merged.concat(await note.getJsonContent());
}
catch (e) {
log.error(`Cannot merge mime types from note=${note.noteId}: ${e.message}`);
}
}
return merged;
}
module.exports = {
get
};