Skip to content
Open
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
4 changes: 2 additions & 2 deletions app/mock-registry/src/Flow/UpdateCities.hs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ validateCities :: [Text] -> Either Text ()
validateCities = \case
[] -> Left "Cities cannot be empty"
cities -> do
let patternStr = "^std:[0-9]{2,8}$"
let patternStr = "^(std|area):[0-9]{2,8}$"
invalidCities = filter (isNothing . matchRegex (mkRegex patternStr) . T.unpack) cities
_ <- case invalidCities of
[] -> Right ()
xs -> Left $ "cities " <> T.pack (show xs) <> " doesn't match the regex pattern:" <> T.pack patternStr
xs -> Left $ "cities " <> T.pack (show xs) <> " doesn't match the regex pattern:\'" <> T.pack patternStr <> "\'"
bool (Right ()) (Left "Cities cannot have duplicates") $ hasDuplicates cities