Add a warning when max runs per day is reached

This commit is contained in:
Gaël Métais
2015-02-06 12:03:02 +01:00
parent d556f84929
commit 5f2553047d
8 changed files with 38 additions and 41 deletions
+26
View File
@@ -0,0 +1,26 @@
var apiService = angular.module('apiService', []);
apiService.factory('API', ['$location', 'Runs', 'Results', function($location, Runs, Results) {
return {
launchTest: function(url) {
Runs.save({
url: url,
waitForResponse: false,
screenshot: true
}, function(data) {
$location.path('/queue/' + data.runId);
}, function(response) {
if (response.status === 429) {
alert('Too many requests, you reached the max number of requests allowed in 24h');
} else {
alert('An error occured...');
}
});
}
};
}]);