Skip to content

Commit

Permalink
[UPD] size limit
Browse files Browse the repository at this point in the history
  • Loading branch information
Viglino committed May 30, 2024
1 parent 29be48b commit 3b24e28
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/MacarteApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ MacarteAPI.prototype.getUsers = function(name, callback) {
*/
MacarteAPI.prototype.getMedias = function(options, callback) {
options = options || {};
options.organization = team.getId();
options.organization_id = team.getId();
this._send('GET', _apiURL+'medias', options, callback);
};

Expand All @@ -502,7 +502,7 @@ MacarteAPI.prototype.getMedias = function(options, callback) {
*/
MacarteAPI.prototype.getMediasFolders = function(callback) {
const options = {
organization: team.getId()
organization_id: team.getId()
};
this._send('GET', _apiURL+'medias/folders', options, callback);
};
Expand All @@ -518,6 +518,7 @@ MacarteAPI.prototype.postMedia = function(img, folder, name, callback) {
formData.append('file', img);
formData.append('folder', folder);
formData.append('name', name);
formData.append('organization_id', team.getId());
this._send('POST', _apiURL+'medias', formData, callback);
};

Expand Down
12 changes: 12 additions & 0 deletions api/team.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ class Team extends ol_Object {
getId() {
return _team.public_id || '';
}
/** Get media size
* @return {number}
*/
getMediasSize() {
return _team.medias_size || 0;
}
/** Get media quota
* @return {number}
*/
getMediaSizeLimit() {
return _team.media_size_limit || 0;
}
/** Check if team is in the list, if not remove the team
* @param {Array<Object>} list
* @returns {boolean}
Expand Down

0 comments on commit 3b24e28

Please sign in to comment.