Skip to content

Commit

Permalink
add validation schema for add stream form
Browse files Browse the repository at this point in the history
  • Loading branch information
lmossman committed Jan 3, 2023
1 parent 6a8be0b commit 16ce351
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import merge from "lodash/merge";
import { useState } from "react";
import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
import * as yup from "yup";

import { Button } from "components/ui/Button";
import { Modal, ModalBody, ModalFooter } from "components/ui/Modal";
Expand Down Expand Up @@ -59,6 +60,10 @@ export const AddStreamButton: React.FC<AddStreamButtonProps> = ({ onAddStream, b
setIsOpen(false);
onAddStream(numStreams);
}}
validationSchema={yup.object().shape({
streamName: yup.string().required("form.empty.error"),
urlPath: yup.string().required("form.empty.error"),
})}
>
<>
<FormikPatch />
Expand Down

0 comments on commit 16ce351

Please sign in to comment.