Skip to content

Commit

Permalink
ZKUI-22 Issue with location during Bucket creation
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas2bert committed Oct 26, 2021
1 parent 9dff743 commit 1ae0d13
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/react/databrowser/buckets/BucketCreate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useOutsideClick } from '../../utils/hooks';

const schema = Joi.object({
name: Joi.string().label('Name').required().min(3).max(63),
locationConstraint: Joi.object(),
locationName: Joi.string().required(),
});

function BucketCreate() {
Expand All @@ -43,9 +43,9 @@ function BucketCreate() {
const formRef = useRef(null);
useOutsideClick(formRef, clearServerError);

const onSubmit = ({ name, locationConstraint }) => {
const onSubmit = ({ name, locationName }) => {
clearServerError();
dispatch(createBucket({ name, locationConstraint: locationConstraint?.value }));
dispatch(createBucket({ name, locationConstraint: locationName }));
};

const handleCancel = () => {
Expand Down Expand Up @@ -88,14 +88,14 @@ function BucketCreate() {
</F.Label>
<Controller
control={control}
id='locationConstraint'
name='locationConstraint'
defaultValue={{ value: 'us-east-1' }}
render={({ onChange, value: locationConstraintObj }) => {
id='locationName'
name='locationName'
defaultValue='us-east-1'
render={({ onChange, value: locationName }) => {
return <F.Select
onChange={onChange}
placeholder='Location Name'
value={locationConstraintObj.value}
value={locationName}
>
{selectLocations.map((opt, i) => <F.Select.Option key={i} value={opt.value}>{renderLocation(opt)}</F.Select.Option>)}
</F.Select>;
Expand Down

0 comments on commit 1ae0d13

Please sign in to comment.