refactor: configure cache api clients via constructor options
This commit is contained in:
@@ -2,22 +2,10 @@ import CacheEnabledApiClient from './CacheEnabledApiClient';
|
||||
|
||||
class AttributeAPI extends CacheEnabledApiClient {
|
||||
constructor() {
|
||||
super('custom_attribute_definitions', { accountScoped: true });
|
||||
}
|
||||
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
get cacheModelName() {
|
||||
return 'custom_attribute_definition';
|
||||
}
|
||||
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
extractDataFromResponse(response) {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
marshallData(dataToParse) {
|
||||
return { data: dataToParse };
|
||||
super('custom_attribute_definitions', {
|
||||
accountScoped: true,
|
||||
cacheModel: 'custom_attribute_definition',
|
||||
});
|
||||
}
|
||||
|
||||
getAttributesByModel() {
|
||||
|
||||
Reference in New Issue
Block a user