diff --git a/backend/src/api/helpers.ts b/backend/src/api/helpers.ts index acc6627f..f3ce9672 100644 --- a/backend/src/api/helpers.ts +++ b/backend/src/api/helpers.ts @@ -12,6 +12,67 @@ import { SES } from 'aws-sdk'; import * as nodemailer from 'nodemailer'; import * as handlebars from 'handlebars'; +export const REGION_STATE_MAP = { + Alabama: '4', + Alaska: '10', + 'American Samoa': '9', + Arkansas: '6', + Arizona: '9', + California: '9', + Colorado: '8', + 'Commonwealth Northern Mariana Islands': '9', + Connecticut: '1', + Delaware: '3', + 'District of Columbia': '3', + 'Federal States of Micronesia': '9', + Florida: '4', + Georgia: '4', + Guam: '9', + Hawaii: '9', + Idaho: '10', + Illinois: '5', + Indiana: '5', + Iowa: '7', + Kansas: '7', + Kentucky: '4', + Louisiana: '6', + Maine: '1', + Maryland: '3', + Massachusetts: '1', + Michigan: '5', + Minnesota: '5', + Mississippi: '4', + Missouri: '7', + Montana: '8', + Nebraska: '7', + Nevada: '9', + 'New Hampshire': '1', + 'New Jersey': '2', + 'New Mexico': '6', + 'New York': '2', + 'North Carolina': '4', + 'North Dakota': '8', + Ohio: '5', + Oklahoma: '6', + Oregon: '10', + Pennsylvania: '3', + 'Puerto Rico': '2', + 'Republic of Marshall Islands': '9', + 'Rhode Island': '1', + 'South Carolina': '4', + 'South Dakota': '8', + Tennessee: '4', + Texas: '6', + Utah: '8', + Vermont: '1', + 'Virgin Islands': '2', + Virginia: '3', + Washington: '10', + 'West Virginia': '3', + Wisconsin: '5', + Wyoming: '8' +}; + export const validateBody = async ( obj: ClassType, body: string | null, diff --git a/backend/src/api/users.ts b/backend/src/api/users.ts index 15ea784c..ccc4a36c 100644 --- a/backend/src/api/users.ts +++ b/backend/src/api/users.ts @@ -19,6 +19,7 @@ import { wrapHandler, NotFound, Unauthorized, + REGION_STATE_MAP, sendEmail, sendUserRegistrationEmail, sendRegistrationApprovedEmail, @@ -146,67 +147,6 @@ class UpdateUser { role: string; } -const REGION_STATE_MAP = { - Connecticut: '1', - Maine: '1', - Massachusetts: '1', - 'New Hampshire': '1', - 'Rhode Island': '1', - Vermont: '1', - 'New Jersey': '2', - 'New York': '2', - 'Puerto Rico': '2', - 'Virgin Islands': '2', - Delaware: '3', - Maryland: '3', - Pennsylvania: '3', - Virginia: '3', - 'District of Columbia': '3', - 'West Virginia': '3', - Alabama: '4', - Florida: '4', - Georgia: '4', - Kentucky: '4', - Mississippi: '4', - 'North Carolina': '4', - 'South Carolina': '4', - Tennessee: '4', - Illinois: '5', - Indiana: '5', - Michigan: '5', - Minnesota: '5', - Ohio: '5', - Wisconsin: '5', - Arkansas: '6', - Louisiana: '6', - 'New Mexico': '6', - Oklahoma: '6', - Texas: '6', - Iowa: '7', - Kansas: '7', - Missouri: '7', - Nebraska: '7', - Colorado: '8', - Montana: '8', - 'North Dakota': '8', - 'South Dakota': '8', - Utah: '8', - Wyoming: '8', - Arizona: '9', - California: '9', - Hawaii: '9', - Nevada: '9', - Guam: '9', - 'American Samoa': '9', - 'Commonwealth Northern Mariana Islands': '9', - 'Republic of Marshall Islands': '9', - 'Federal States of Micronesia': '9', - Alaska: '10', - Idaho: '10', - Oregon: '10', - Washington: '10' -}; - /** * @swagger *