Commit eab43ca8 authored by Imran Hussain's avatar Imran Hussain
Browse files

Merge branch 'issue_#17' into 'master'

Fix #17 by checking if there's more than one member type and returning the correct data

Closes #17

See merge request !3
parents 0b33ef7b ef2530b8
Pipeline #716 passed with stages
in 9 minutes and 49 seconds
......@@ -58,7 +58,12 @@ module.exports = {
const apiResponse = await getContent(apiurl);
return JSON.parse(apiResponse).table1.table1_Product_Collection.table1_Product[0].Detail_Collection.Detail;
// Check to see if we only get one type of member
if (apiResponse.table1.table1_Product_Collection.table1_Product[0] === undefined) {
return JSON.parse(apiResponse).table1.table1_Product_Collection.table1_Product.Detail_Collection.Detail;
} else {
return JSON.parse(apiResponse).table1.table1_Product_Collection.table1_Product[0].Detail_Collection.Detail;
}
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment