encapsulating in communication component + update js tests

This commit is contained in:
Jonathan Labreuille
2016-08-08 11:36:29 +02:00
parent 1305a10ee0
commit c136d91dd2
5 changed files with 64 additions and 35 deletions

View File

@ -36,36 +36,46 @@ define([
return Module._cachedQuery({
action: 'getTaxonomies',
options: {
postType: postType,
},
postType: postType
}
}).then(function(response) {
return response.data;
});
};
Module.getTerms = function(options) {
return Module._cachedQuery({
action: 'getTerms',
options: options,
options: options
}).then(function(response) {
return response.data;
});
};
Module.getPosts = function(options) {
return Module._cachedQuery({
action: 'getPosts',
options: options,
options: options
}).then(function(response) {
return response.data;
});
};
Module.getTransformedPosts = function(options) {
return Module._cachedQuery({
action: 'getTransformedPosts',
options: options,
options: options
}).then(function(response) {
return response.data;
});
};
Module.getBulkTransformedPosts = function(options) {
return Module._query({
action: 'getBulkTransformedPosts',
options: options,
options: options
}).then(function(response) {
return response.data;
});
};