feat: add transformPayloadFilter method to IDataTransformer and integrate it in getMany for filter transformation
This commit is contained in:
@@ -168,7 +168,11 @@ export abstract class BaseRemoteDataServices<E extends BaseEntity = BaseEntity,
|
||||
* through `transformGetManyResponse()` before being returned.
|
||||
*/
|
||||
async getMany<T = E[]>(config?: AxiosRequestConfig): Promise<ApiResponse<T>> {
|
||||
const result = await this.execute<T>(DESCRIPTORS.getMany, { config });
|
||||
const finalConfig = config?.params && this.transformer?.transformPayloadFilter
|
||||
? { ...config, params: this.transformer.transformPayloadFilter(config.params) }
|
||||
: config;
|
||||
|
||||
const result = await this.execute<T>(DESCRIPTORS.getMany, { config: finalConfig });
|
||||
|
||||
if (this.transformer && Array.isArray(result.data)) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user