angular
	.module('dating.models.locations', [])
	.service('LocationsModel', function ($http, ApiPrefixService, globalParamsService) {
		var GLOBALS = globalParamsService.GLOBALS;
		var model = this,
			URLS = {
				GET_CURRENT_LOCATION: '/location/current'
			};

		if (GLOBALS.isHeadless) {
			for (var key in URLS) {
				if (Object.prototype.hasOwnProperty.call(URLS, key)) {
					URLS[key] = ApiPrefixService.prefixUrl(URLS[key]);
				}
			}
		}

		model.getCurrent = function () {
			return $http.get(URLS.GET_CURRENT_LOCATION);
		};
	});
