1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-22 22:59:43 +02:00

Pinned documents

Closes #278

Pin documents to the top of each space.
This commit is contained in:
sauls8t 2020-02-03 21:00:35 +00:00
parent 2b66d0096a
commit e014f5b5c1
18 changed files with 541 additions and 88 deletions

View file

@ -567,7 +567,37 @@ export default Service.extend({
}).catch((error) => {
return error;
});
}
},
//**************************************************
// Pinning documents inside spaces.
//**************************************************
// Pin document
pin(documentId) {
return this.get('ajax').request(`document/pin/${documentId}`, {
method: 'POST'
}).then((response) => {
return response;
});
},
// Unpin document
unpin(documentId) {
return this.get('ajax').request(`document/unpin/${documentId}`, {
method: 'DELETE'
}).then((response) => {
return response;
});
},
onPinSequence(documentId, direction) {
return this.get('ajax').request(`document/pinmove/${documentId}?direction=${direction}`, {
method: 'POST'
}).then((response) => {
return response;
});
}
});
function isObject(a) {