support for promoted multi value attributes

This commit is contained in:
azivner
2018-08-06 17:24:35 +02:00
parent 21551d7b77
commit fcf6141cde
4 changed files with 118 additions and 54 deletions

View File

@@ -76,6 +76,21 @@ async function updateNoteAttribute(req) {
attribute.value = body.value;
await attribute.save();
return {
attributeId: attribute.attributeId
};
}
async function deleteNoteAttribute(req) {
const attributeId = req.params.attributeId;
const attribute = await repository.getAttribute(attributeId);
if (attribute) {
attribute.isDeleted = 1;
await attribute.save();
}
}
async function updateNoteAttributes(req) {
@@ -129,6 +144,7 @@ async function getValuesForAttribute(req) {
module.exports = {
updateNoteAttributes,
updateNoteAttribute,
deleteNoteAttribute,
getAttributeNames,
getValuesForAttribute,
getEffectiveNoteAttributes