Skip to content

Commit 77a604e

Browse files
author
alfredbrockotter
committed
fix: Renamed getPromise to toPromise
1 parent 372e7df commit 77a604e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/services/CacheService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default class CacheService {
99
viaCache(query, seconds, cacheKey, isServerProcess) {
1010
// Always perform a query when on the server
1111
if (this.cacheEntries && query && isServerProcess) {
12-
return query.getPromise();
12+
return query.toPromise();
1313
};
1414

1515
if (!seconds) {
@@ -28,7 +28,7 @@ export default class CacheService {
2828
});
2929
}
3030
else {
31-
return query.getPromise().then(response => {
31+
return query.toPromise().then(response => {
3232
if (cacheEntry) {
3333
cacheEntry.timestamp = new Date();
3434
}

tests/cacheService.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ should();
88
chai.use(chaiAsPromised);
99

1010
const query = {
11-
getPromise: () => {
11+
toPromise: () => {
1212
return new Promise(function (resolve, reject) {
1313
resolve('fake data');
1414
});
@@ -40,7 +40,7 @@ describe('Test the behavior of the CacheService', function () {
4040
expect(s).to.equal(null);
4141
});
4242
});
43-
it('viaCache method returns response from \'getPromise\'', () => {
43+
it('viaCache method returns response from \'toPromise\'', () => {
4444
let service = new CacheService([]);
4545

4646
return service.viaCache(query, 10, 'key1', false).then(s => {

0 commit comments

Comments
 (0)