Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 1c3920d

Browse files
committed
Update ProjectObject.js
1 parent 2c001c5 commit 1c3920d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

modules/Project/ProjectObject.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ module.factory('ProjectObject', (BaseObject, $http) => {
1313

1414

1515
create() {
16-
return $http.post('/api/projects', this )
16+
return this.cache('creating', () => $http.post('/api/projects', this )
1717
.then( (response) => {
1818
this.id = response.data.id;
1919
return response.data;
20-
});
20+
})
21+
);
2122
}
2223

2324
update() {
24-
return $http.put(`/api/projects/${this.id}`, this);
25+
return this.cache('updating', () => $http.put(`/api/projects/${this.id}`, this) );
2526
}
2627
}
2728

0 commit comments

Comments
 (0)