Skip to content

Commit a4db888

Browse files
Merge pull request #201 from GSA/manual-check-api
fix: update boolean handling to support both string and boolean compl…
2 parents 3f12fc6 + 909b41b commit a4db888

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

server/routes/document.routes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ router.post('/analyze-documents', express.json(), async (req, res) => {
7575
for (const fname in result.predictions) {
7676
const prediction = result.predictions[fname];
7777
logger.info(`Document: ${fname}, Prediction: ${prediction}`);
78-
// Convert string booleans to actual booleans if necessary
79-
const isCompliant = (prediction === true || prediction === 'True');
78+
// Handle both boolean and string cases
79+
const isCompliant = prediction === true || prediction === 'True' || prediction === 'compliant';
8080
transformed[fname] = isCompliant ? 'compliant' : 'non-compliant';
8181
}
8282

0 commit comments

Comments
 (0)