Add UI bits for setting backgroundImage
This commit is contained in:
@@ -1938,6 +1938,27 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
}
|
||||
};
|
||||
|
||||
Client.prototype.getBackgroundImageUrl = function () {
|
||||
return client.apiOrigin + '/api/v1/profile/backgroundImage?access_token=' + token + '&bustcache=' + Date.now();
|
||||
};
|
||||
|
||||
Client.prototype.setBackgroundImage = function (backgroundImage, callback) {
|
||||
// Blob type if object
|
||||
var fd = new FormData();
|
||||
fd.append('backgroundImage', backgroundImage);
|
||||
|
||||
var config = {
|
||||
headers: { 'Content-Type': undefined },
|
||||
transformRequest: angular.identity
|
||||
};
|
||||
|
||||
post('/api/v1/profile/backgroundImage', fd, config, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 202) return callback(new ClientError(status, data));
|
||||
callback(null);
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.makeUserLocal = function (userId, callback) {
|
||||
post('/api/v1/users/' + userId + '/make_local', {}, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
|
||||
Reference in New Issue
Block a user