mirror of
https://github.com/openMF/community-app.git
synced 2026-02-06 13:17:04 +00:00
25 lines
1.1 KiB
JavaScript
25 lines
1.1 KiB
JavaScript
(function (module) {
|
|
mifosX.controllers = _.extend(module, {
|
|
ClientIdentifierController: function (scope, routeParams, location, resourceFactory) {
|
|
scope.clientId = routeParams.clientId;
|
|
scope.formData = {};
|
|
scope.documenttypes = [];
|
|
resourceFactory.clientIdenfierTemplateResource.get({clientId: routeParams.clientId}, function (data) {
|
|
scope.documenttypes = data.allowedDocumentTypes;
|
|
scope.formData.documentTypeId = data.allowedDocumentTypes[0].id;
|
|
});
|
|
|
|
scope.submit = function () {
|
|
resourceFactory.clientIdenfierResource.save({clientId: scope.clientId}, this.formData, function (data) {
|
|
location.path('/viewclient/' + data.clientId);
|
|
});
|
|
};
|
|
|
|
}
|
|
});
|
|
mifosX.ng.application.controller('ClientIdentifierController', ['$scope', '$routeParams', '$location', 'ResourceFactory', mifosX.controllers.ClientIdentifierController]).run(function ($log) {
|
|
$log.info("ClientIdentifierController initialized");
|
|
});
|
|
}(mifosX.controllers || {}));
|
|
|