Remove "pws:" prefix from PWS ID

This commit is contained in:
Matthew Oslan
2019-07-12 20:04:25 -04:00
parent 3038728d4a
commit 2992df9c33
2 changed files with 3 additions and 3 deletions

View File

@@ -221,8 +221,8 @@ export const getWateringData = async function( req: express.Request, res: expres
let pws: PWS | undefined = undefined;
if ( adjustmentOptions.pws && adjustmentOptions.key ) {
const idMatch = adjustmentOptions.pws.match( /^pws:([a-zA-Z\d]+)$/ );
const pwsId = idMatch ? idMatch[ 1 ] : undefined;
const idMatch = adjustmentOptions.pws.match( /^[a-zA-Z\d]+$/ );
const pwsId = idMatch ? idMatch[ 0 ] : undefined;
const keyMatch = adjustmentOptions.key.match( /^[a-f\d]{32}$/ );
const apiKey = keyMatch ? keyMatch[ 0 ] : undefined;