I am having API Call, GET from one controller. based on the response, I need to call another Controller POST
I am having issue doing that using redirect(), I am getting "Cannot Get" because the second API call is POST method.
async retrieveOrgUnit(@RequestHeader(HeadersDto) headers: HeadersDto, @Param() params: OrganizationGetUnitDto, @Body() offerDto, @Res() response: Response, cpg: ChargingProvisioningGateway) {
let result = await cpg.organizationUnit.getOrgUnitProfile({
path: {
customerExternalId: params.orgId,
orgUnitExternalId: params.orgId
},
body: {}
}).then(async res => {
res.status
if( res.data.status === 22){
**await response.redirect(307, '/offer')**
}
return res.data
}).catch(err => {
Logger.log('Failed, Error: ' + err);
return err.status ? err.status : err.data ? err.data : err
})
if you could see in response.redirect(307, '/offer') I am calling another controller that is calling POST API, but the method is being GET. any advice how to do that?!