feat: add transformPayloadFilter method to IDataTransformer and integrate it in getMany for filter transformation

This commit is contained in:
Firman Ramdhani
2026-07-20 14:29:20 +07:00
parent f2cff7699a
commit efa1c086a0
2 changed files with 24 additions and 1 deletions
@@ -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 {