diff --git a/packages/validation/.changeset/pr-10063-changed-1705088599651.md b/packages/validation/.changeset/pr-10063-changed-1705088599651.md new file mode 100644 index 00000000000..032b38bb4ea --- /dev/null +++ b/packages/validation/.changeset/pr-10063-changed-1705088599651.md @@ -0,0 +1,5 @@ +--- +"@linode/validation": Changed +--- + +Revised createObjectStorageKeysSchema to include optional 'regions' field ([#10063](https://github.com/linode/manager/pull/10063)) diff --git a/packages/validation/src/objectStorageKeys.schema.ts b/packages/validation/src/objectStorageKeys.schema.ts index 5ebd2be3cc1..9f9406dc3c8 100644 --- a/packages/validation/src/objectStorageKeys.schema.ts +++ b/packages/validation/src/objectStorageKeys.schema.ts @@ -1,4 +1,4 @@ -import { object, string } from 'yup'; +import { object, string, array } from 'yup'; export const createObjectStorageKeysSchema = object({ label: string() @@ -6,4 +6,8 @@ export const createObjectStorageKeysSchema = object({ .min(3, 'Label must be between 3 and 50 characters.') .max(50, 'Label must be between 3 and 50 characters.') .trim(), + regions: array() + .of(string()) + .min(1, 'Regions must include at least one region') + .notRequired(), });