Skip to content

Commit

Permalink
Update boundaryValidator.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
ashish-egov authored Aug 1, 2024
1 parent 500627e commit 96e5d93
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function validateBoundarySheetHeaders(headersOfBoundarySheet: any[], hierarchy:
const boundaryCodeIndex = headersOfBoundarySheet.indexOf(localizedBoundaryCode);
const keysBeforeBoundaryCode = boundaryCodeIndex === -1 ? headersOfBoundarySheet : headersOfBoundarySheet.slice(0, boundaryCodeIndex);
if (keysBeforeBoundaryCode.some((key: any, index: any) => (key === undefined || key === null) || key !== hierarchy[index]) || keysBeforeBoundaryCode.length !== hierarchy.length) {
const errorMessage = `"Boundary Sheet Headers are not the same as the hierarchy present for the given tenant and hierarchy type: ${request?.query?.hierarchyType}"`;
const errorMessage = `Boundary Sheet Headers are not the same as the hierarchy present for the given tenant and hierarchy type: ${request?.query?.hierarchyType}`;
throwError("BOUNDARY", 400, "BOUNDARY_SHEET_HEADER_ERROR", errorMessage);
}
}
Expand Down Expand Up @@ -89,4 +89,4 @@ export function validateSearchBoundaryDetailRequest(request: any) {
export async function validateBoundaryTemplateGenerateRequest(request: any) {
validateBodyViaSchema(boundaryTemplateGenerateBodySchema, request.query);
validateHierarchyType(request, request?.query?.hierarchyType, request?.query?.tenantId);
}
}

0 comments on commit 96e5d93

Please sign in to comment.