refactor: configure cache api clients via constructor options

This commit is contained in:
Shivam Mishra
2026-06-10 12:46:10 +05:30
parent ac5b3a38c5
commit 880c5e8bf4
7 changed files with 30 additions and 86 deletions
+4 -16
View File
@@ -4,22 +4,10 @@ import CacheEnabledApiClient from './CacheEnabledApiClient';
class CannedResponse extends CacheEnabledApiClient {
constructor() {
super('canned_responses', { accountScoped: true });
}
// eslint-disable-next-line class-methods-use-this
get cacheModelName() {
return 'canned_response';
}
// 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('canned_responses', {
accountScoped: true,
cacheModel: 'canned_response',
});
}
get({ searchKey } = {}) {