Skip to content

Commit 712bb8b

Browse files
author
Cameron Cundiff
committed
Filter fields that get POSTed
- AccessLint::Rails complains on `null` attributes. - This change includes only the attributes we care about right now.
1 parent caf6816 commit 712bb8b

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

src/reporter.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,32 @@ import request from "browser-request";
33
const url = "/access_lint/errors"
44

55
export default function (message) {
6-
const violations = message.violations;
6+
var violations = message.violations.map(function(violation) {
7+
return {
8+
description: violation.description,
9+
help: violation.help,
10+
helpUrl: violation.helpUrl,
11+
id: violation.id,
12+
nodes: violation.nodes.map(function(n) {
13+
return {
14+
target: n.target,
15+
impact: n.impact
16+
};
17+
}),
18+
tags: violation.tags
19+
};
20+
});
721

822
if (violations.length > 0) {
923
request({
1024
method: "POST",
1125
url: url,
12-
json: message,
26+
json: {
27+
accesslint: {
28+
violations: violations,
29+
url: window.location.pathname
30+
}
31+
}
1332
}, function() {});
1433
}
1534
}

0 commit comments

Comments
 (0)