Skip to content

Commit 909b41b

Browse files
fix: update boolean handling to support both string and boolean compliance values
1 parent 79b6b79 commit 909b41b

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)