added withThumbnail param to project list fetch methods

upd4.2
Bernat Romagosa 2017-10-24 12:58:37 +02:00
rodzic c24e499ba9
commit 15729044b7
1 zmienionych plików z 13 dodań i 3 usunięć

Wyświetl plik

@ -330,19 +330,29 @@ Cloud.prototype.saveProject = function (ide, onSuccess, onError) {
);
};
Cloud.prototype.getProjectList = function (onSuccess, onError) {
Cloud.prototype.getProjectList = function (onSuccess, onError, withThumbnail) {
var path = '/projects/%username';
if (withThumbnail) {
path += '?withthumbnail=true';
}
this.withCredentialsRequest(
'GET',
'/projects/%username',
path,
onSuccess,
onError,
'Could not fetch projects'
);
};
Cloud.prototype.getPublishedProjectList = function (username, page, pageSize, searchTerm, onSuccess, onError) {
Cloud.prototype.getPublishedProjectList = function (username, page, pageSize, searchTerm, onSuccess, onError, withThumbnail) {
var path = '/projects' + (username ? '/' + username : '') + '?ispublished=true';
if (withThumbnail) {
path += '&withthumbnail=true';
}
if (page) {
path += '&page=' + page + '&pagesize=' + (pageSize || 16);
}