最佳答案
我想从响应中删除 drugName,但它没有发生任何想法如何从传播操作符中删除属性? 主要的
const transformedResponse = transformResponse(response);
const loggerResponse = {...transformedResponse};
delete loggerResponse[drugName];
console.log("LOGGER>>>>", loggerResponse);
logger().info('Drug Price Response=', { ...loggerResponse, memberId: memberId, pharmacyId: pharmacyId });
\ 资料
LOGGER>>>> {
'0': {
isBrand: false,
drugName: 'test drug',
drugStrength: '5 mg 1 5 mg',
drugForm: 'Tablet',
}
}
转换响应
[{
drugName: 'HYDROCODONE-HOMATROPINE MBR',
drugStrength: '5MG-1.5MG',
drugForm: 'TABLET',
brand: false
}]