Unify feedback and ticket forms

This commit is contained in:
Johannes Zellner
2015-08-04 23:30:53 +02:00
parent 7d58d69389
commit 0b4256a992
3 changed files with 15 additions and 78 deletions

View File

@@ -469,22 +469,9 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification',
}).error(defaultErrorHandler(callback));
};
Client.prototype.feedback = function (subject, description, callback) {
Client.prototype.feedback = function (type, 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',
type: type,
subject: subject,
description: description
};