Skip to content

Commit

Permalink
AT: fixed bug where assets were not retrieved correctly when switchin…
Browse files Browse the repository at this point in the history
…g between projects.
  • Loading branch information
hirokiterashima committed Nov 4, 2016
1 parent 06347f5 commit 944d17e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
11 changes: 7 additions & 4 deletions src/main/webapp/wise5/services/projectAssetService.es6
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ class ProjectAssetService {
this.ConfigService = ConfigService;
this.Upload = Upload;
this.projectAssets = {};
this.projectAssetURL = this.ConfigService.getConfigParam('projectAssetURL');
this.projectAssetTotalSizeMax = this.ConfigService.getConfigParam('projectAssetTotalSizeMax');
this.projectAssetUsagePercentage = 0;
}

deleteAssetItem(assetItem) {
var projectAssetURL = this.ConfigService.getConfigParam('projectAssetURL');

var httpParams = {};
httpParams.method = 'POST';
httpParams.url = this.projectAssetURL;
httpParams.url = projectAssetURL;
httpParams.headers = {'Content-Type': 'application/x-www-form-urlencoded'};

var params = {};
Expand All @@ -34,18 +34,21 @@ class ProjectAssetService {
}

retrieveProjectAssets() {
var projectAssetURL = this.ConfigService.getConfigParam('projectAssetURL');

return this.$http.get(this.projectAssetURL).then((result) => {
return this.$http.get(projectAssetURL).then((result) => {
var projectAssetsJSON = result.data;
this.projectAssets = projectAssetsJSON;
return projectAssetsJSON;
});
}

uploadAssets(files) {
var projectAssetURL = this.ConfigService.getConfigParam('projectAssetURL');

var promises = files.map((file) => {
return this.Upload.upload({
url: this.projectAssetURL,
url: projectAssetURL,
fields: {
},
file: file
Expand Down
13 changes: 9 additions & 4 deletions src/main/webapp/wise5/services/projectAssetService.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/main/webapp/wise5/services/projectAssetService.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 944d17e

Please sign in to comment.