Reskin: Fix #2133 - 'Submit' button is not working on Upload Client Document Page

This commit is contained in:
Anh3h 2017-06-02 16:37:03 +01:00
parent 4e15e5a58b
commit 61f9cdac97
2 changed files with 4 additions and 5 deletions

View File

@ -2,15 +2,14 @@
mifosX.controllers = _.extend(module, {
ClientDocumentController: function (scope, location, http, routeParams, API_VERSION, Upload, $rootScope) {
scope.clientId = routeParams.clientId;
scope.onFileSelect = function ($files) {
scope.file = $files[0];
scope.onFileSelect = function (files) {
scope.formData.file = files[0];
};
scope.submit = function () {
Upload.upload({
url: $rootScope.hostUrl + API_VERSION + '/clients/' + scope.clientId + '/documents',
data: scope.formData,
file: scope.file
data: { name : scope.formData.name, description : scope.formData.description, file: scope.formData.file},
}).then(function (data) {
// to fix IE not refreshing the model
if (!scope.$$phase) {

View File

@ -35,7 +35,7 @@
class="required">*</span></label>
<div class="col-sm-3">
<input type="file" id="file" nv-file-select="onFileSelect($files)">
<input type="file" id="file" ngf-select="onFileSelect($files)">
</div>
</div>