Merge pull request #13422 from supabase/regex-postgres-version

chore: validation for postgres version
This commit is contained in:
Kevin Grüneberg authored and GitHub committed 2023-04-11 10:48:41 +02:00
commit 76c9bebf80
1 file changed
+10
+10
View File
@@ -169,6 +169,15 @@ const Wizard: NextPageWithLayout = () => {
kps_enabled: kpsEnabled,
}
if (postgresVersion) {
if (!postgresVersion.match(/1[2-9]\..*/)) {
setNewProjectLoading(false)
ui.setNotification({
category: 'error',
message: `Invalid Postgres version, should start with a number between 12-19, a dot and additional characters, i.e. 15.2 or 15.2.0-3`,
})
return
}
data['custom_supabase_internal_requests'] = {
ami: { search_tags: { 'tag:postgresVersion': postgresVersion } },
}
@@ -310,6 +319,7 @@ const Wizard: NextPageWithLayout = () => {
id="custom-postgres-version"
layout="horizontal"
label="Postgres Version"
autoComplete="off"
descriptionText={
<p>
Specify a custom version of Postgres (Defaults to the latest)