Skip to content

Commit

Permalink
Merge pull request #280 from cotype/feature/fixSlugDuplicate
Browse files Browse the repository at this point in the history
fix(client): Slug editable in Duplicate
  • Loading branch information
mo-hh234 authored Jun 23, 2020
2 parents fe0cbf9 + 534592c commit 0ee8cbb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions client/src/Edit/elements/SlugInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Input } from "../../common/styles";
import { required } from "./validation";
import TextOutput from "./TextOutput";

type Props = FieldProps<any> & { required?: boolean };
type Props = FieldProps<any> & { required?: boolean; id?:string };
export default class SlugInput extends Component<Props> {
static getDefaultValue(props: Props) {
return "";
Expand All @@ -22,11 +22,12 @@ export default class SlugInput extends Component<Props> {
};

render() {
const { field, form } = this.props;
const { field, form,id } = this.props;
if (
form.initialValues[field.name] === undefined ||
form.initialValues[field.name] === null ||
form.initialValues[field.name] === ""
form.initialValues[field.name] === "" ||
id === undefined
) {
const { value = "", ...props } = field;
return (
Expand Down

0 comments on commit 0ee8cbb

Please sign in to comment.