<commit_before>'use strict';

// Declare app level module which depends on views, and components
angular.module('schedulerApp.db.mock', [
  'ngResource'
])
.factory('dbMock', [ '$resource', '$q', function($resource, $q) {

	var
		counter = 0,
		service = {
			rooms:  $resource("services/mocks/rooms.js").get(),
			things: $resource("services/mocks/things.js").get(),
			tasks: { },
			save: function(task) {
				if (! task.id || task.id == '') {
					task.id = ++counter;
				}
				service.tasks[task.id] = task
				var deferred = $q.defer()
				deferred.resolve(service)
				console.debug("saved task", task)
				return deferred.promise
			},
			delete: function(id) {
				delete service.tasks[task.id]
				var deferred = $q.defer()
				deferred.resolve(service)
				return deferred.promise
			},
			refresh: function() {
				var deferred = $q.defer()
				deferred.resolve(service)
				return deferred.promise
			}
		}
	return service
}])<commit_msg>fix: parameter is an id, not a task.<commit_after>'use strict';

// Declare app level module which depends on views, and components
angular.module('schedulerApp.db.mock', [
  'ngResource'
])
.factory('dbMock', [ '$resource', '$q', function($resource, $q) {

	var
		counter = 0,
		service = {
			rooms:  $resource("services/mocks/rooms.js").get(),
			things: $resource("services/mocks/things.js").get(),
			tasks: { },
			save: function(task) {
				if (! task.id || task.id == '') {
					task.id = ++counter;
				}
				service.tasks[task.id] = task
				var deferred = $q.defer()
				deferred.resolve(service)
				console.debug("saved task", task)
				return deferred.promise
			},
			delete: function(id) {
				delete service.tasks[id]
				var deferred = $q.defer()
				deferred.resolve(service)
				return deferred.promise
			},
			refresh: function() {
				var deferred = $q.defer()
				deferred.resolve(service)
				return deferred.promise
			}
		}
	return service
}])
{'fraction_non_alphanumeric': 0.16337148803329865, 'fraction_numerical': 0.001040582726326743, 'mean_word_length': 3.1804347826086956, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '497012', 'n_tokens_mistral': 780, 'n_tokens_neox': 625, 'n_words': 139}