Skip to content

Commit

Permalink
feat #OBS-I501 request response changes
Browse files Browse the repository at this point in the history
  • Loading branch information
HarishGangula committed Jan 15, 2025
1 parent 3ddf7c7 commit 45c6e34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion api-service/src/connections/commandServiceConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,5 @@ export const registerConnector = async (requestBody: any, userToken: string) =>
}

export const detectPII = async (requestBody: any, userToken: string) => {
console.log(`analyzePIIPath : ${analyzePIIPath}`)
return commandHttpService.post(analyzePIIPath, requestBody, { headers: { Authorization: userToken }})
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ export const dataAnalyzePII = async (req: Request, res: Response) => {
const apiId = _.get(req, 'id')
try {
const userToken = req.get('authorization') as string;
const piiSuggestionsResponse = await detectPII(_.get(req, ['body', 'data']), userToken);
const piiSuggestionsResponse = await detectPII(_.get(req, ['body', 'request']), userToken);
logger.info({apiId , message: `Detected PII successfully` })
ResponseHandler.successResponse(req, res, { status: httpStatus.OK, data: piiSuggestionsResponse?.data})
ResponseHandler.successResponse(req, res, { status: httpStatus.OK, data: _.get(piiSuggestionsResponse, ["data", "result"]) });
} catch (error: any) {
const errMessage = _.get(error, "response.data.detail")
logger.error(error, apiId, code);
Expand Down

0 comments on commit 45c6e34

Please sign in to comment.