Skip to content

Commit a498e1c

Browse files
author
JF
committed
filters promise
1 parent b8bf3cf commit a498e1c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/hydra/parseHydraDocumentation.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,16 @@ async function addFilters(api) {
195195

196196
let response = await fetchResource(resource.url);
197197

198-
if (response["filters"]) {
199-
for (const filter of response["filters"]) {
200-
let property = filter["property"];
198+
if (response.filters) {
199+
for (const filter of response.filters) {
200+
let property = filter.property;
201201

202-
// To prevent PropertyFilter, maybe should be handle specifically ?
202+
// TODO : To prevent PropertyFilter, maybe should be handle specifically ?
203203
if (property === null) {
204204
continue;
205205
}
206206

207-
const resourceFilter = new Filter(property, filter["variable"]);
207+
const resourceFilter = new Filter(property, filter.variable);
208208

209209
resourceFilters.push(resourceFilter);
210210
}
@@ -482,8 +482,8 @@ export default function parseHydraDocumentation(entrypointUrl, options = {}) {
482482
})
483483
)
484484
.then(({ api, response, status }) => {
485-
addFilters(api);
486-
487-
return { api, response, status };
485+
return addFilters(api).then(api => {
486+
return { api, response, status };
487+
});
488488
});
489489
}

0 commit comments

Comments
 (0)