Do the feedback and ticket form plumbing

This commit is contained in:
Johannes Zellner
2015-08-04 14:44:39 +02:00
parent da48e32bcc
commit 7b9930c7f0
3 changed files with 79 additions and 6 deletions

View File

@@ -469,6 +469,32 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification',
}).error(defaultErrorHandler(callback));
};
Client.prototype.feedback = function (subject, description, callback) {
var data = {
type: 'feedback',
subject: subject,
description: description
};
$http.post(client.apiOrigin + '/api/v1/cloudron/feedback', data).success(function (data, status) {
if (status !== 201) return callback(new ClientError(status, data));
callback(null);
}).error(defaultErrorHandler(callback));
};
Client.prototype.ticket = function (subject, description, callback) {
var data = {
type: 'ticket',
subject: subject,
description: description
};
$http.post(client.apiOrigin + '/api/v1/cloudron/feedback', data).success(function (data, status) {
if (status !== 201) return callback(new ClientError(status, data));
callback(null);
}).error(defaultErrorHandler(callback));
};
Client.prototype.createUser = function (username, email, callback) {
var data = {
username: username,