Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions sandbox/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ async function conditionsAchalasia(req, res, next) {
// Apigee Production environment ('apikey' required in Header)
// https://api.service.nhs.uk/nhs-website-content/conditions/acne/?modules=true
async function conditionsAcne(req, res, next) {
if (req.query.modules.toLowerCase() === 'true') {
res.status(200).json(conditionsAcneModulesTrueResponse)
} else {
if (!req.query.modules || req.query.modules.toLowerCase() === 'false') {
res.status(200).json(conditionsAcneNoParamsResponse)
} else if (req.query.modules?.toLowerCase() === 'true') {
res.status(200).json(conditionsAcneModulesTrueResponse)
}
res.end()
next()
Expand All @@ -338,10 +338,10 @@ async function conditionsAcne(req, res, next) {
// Apigee Sandbox environment (no auth key required)
// https://sandbox.api.service.nhs.uk/nhs-website-content/conditions/*?modules=true
async function conditionsWildcard(req, res, next) {
if (req.query.modules.toLowerCase() === 'true') {
res.status(200).json(conditionsWildcardModulesTrueResponse)
} else {
if (!req.query.modules || req.query.modules.toLowerCase() === 'false') {
res.status(200).json(conditionsWildcardResponseNoParams)
} else if (req.query.modules.toLowerCase() === 'true') {
res.status(200).json(conditionsWildcardModulesTrueResponse)
}
res.end()
next()
Expand Down Expand Up @@ -595,10 +595,10 @@ async function medicinesAciclovir(req, res, next) {
// Apigee Production environment ('apikey' required in Header)
// https://api.service.nhs.uk/nhs-website-content/medicines/acrivastine/?modules=true
async function medicinesAcrivastine(req, res, next) {
if (req.query.modules.toLowerCase() === 'true') {
res.status(200).json(medicinesAcrivastineModulesTrueResponse)
} else {
if (!req.query.modules || req.query.modules.toLowerCase() === 'false') {
res.status(200).json(medicinesAcrivastineNoParamsResponse)
} else if (req.query.modules.toLowerCase() === 'true') {
res.status(200).json(medicinesAcrivastineModulesTrueResponse)
}
res.end()
next()
Expand All @@ -616,10 +616,10 @@ async function medicinesAcrivastine(req, res, next) {
// Apigee Sandbox environment (no auth key required)
// https://sandbox.api.service.nhs.uk/nhs-website-content/medicines/*?modules=true
async function medicinesWildcard(req, res, next) {
if (req.query.modules.toLowerCase() === 'true') {
res.status(200).json(medicinesWildcardModulesTrueResponse)
} else {
if (!req.query.modules || req.query.modules.toLowerCase() === 'false') {
res.status(200).json(medicinesWildcardNoParamsResponse)
} else if (req.query.modules.toLowerCase() === 'true') {
res.status(200).json(medicinesWildcardModulesTrueResponse)
}
res.end()
next()
Expand Down