mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
28 lines
599 B
JavaScript
28 lines
599 B
JavaScript
import server from './server.js';
|
|
|
|
async function addLabel(noteId, name, value = "") {
|
|
await server.put(`notes/${noteId}/attribute`, {
|
|
type: 'label',
|
|
name: name,
|
|
value: value
|
|
});
|
|
}
|
|
|
|
async function setLabel(noteId, name, value = "") {
|
|
await server.put(`notes/${noteId}/set-attribute`, {
|
|
type: 'label',
|
|
name: name,
|
|
value: value
|
|
});
|
|
}
|
|
|
|
async function removeAttributeById(noteId, attributeId) {
|
|
await server.remove(`notes/${noteId}/attributes/${attributeId}`);
|
|
}
|
|
|
|
export default {
|
|
addLabel,
|
|
setLabel,
|
|
removeAttributeById
|
|
}
|