From 42ef212a589080db3205234afa65da9c70959219 Mon Sep 17 00:00:00 2001 From: Cameron Pettit <71421099+cameronpettit@users.noreply.github.com> Date: Wed, 29 Nov 2023 10:40:51 -0800 Subject: [PATCH] PDR-224: updating cron to search for status=established (#333) * PDR-224: updating cron to search for status=established * adding semicolons --- lambda/dataRegisterUtils.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lambda/dataRegisterUtils.js b/lambda/dataRegisterUtils.js index 57f86dab..feade372 100644 --- a/lambda/dataRegisterUtils.js +++ b/lambda/dataRegisterUtils.js @@ -3,9 +3,10 @@ const { logger } = require('./logger'); const DATA_REGISTRY_URL = process.env.DATA_REGISTRY_URL; const DATA_REGISTER_NAME_API_KEY = process.env.DATA_REGISTER_NAME_API_KEY; +const ESTABLISHED_STATE = 'established'; async function getCurrentNameData(identifier) { - const url = DATA_REGISTRY_URL + `/parks/${identifier}/name?status=current` + const url = DATA_REGISTRY_URL + `/parks/${identifier}/name?status=${ESTABLISHED_STATE}`; try { const data = await axios({ method: 'get', @@ -18,7 +19,7 @@ async function getCurrentNameData(identifier) { }) return data; } catch (err) { - logger.error(`Failed to get current name data for ${identifier}.`, err); + logger.error(`Failed to get established name data for ${identifier}.`, err); throw err; } } @@ -30,7 +31,7 @@ async function getCurrentDisplayNameById(identifier) { let item = data?.data?.data?.items[0]; return item?.displayName || null; } catch (err) { - logger.error('Failed to get current display name by id.', err); + logger.error('Failed to get established display name by id.', err); throw err; } }