Fix sending type when new attribute (#3058)

This commit is contained in:
poulch 2023-01-26 16:21:22 +01:00 committed by GitHub
parent b510d68fa9
commit 301b488277
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -139,6 +139,7 @@ const AttributePage: React.FC<AttributePageProps> = ({
const handleSubmit = (data: AttributePageFormData) => {
const metadata = !attribute || isMetadataModified ? data.metadata : [];
const type = attribute === null ? data.type : undefined;
const privateMetadata =
!attribute || isPrivateMetadataModified ? data.privateMetadata : [];
@ -147,7 +148,7 @@ const AttributePage: React.FC<AttributePageProps> = ({
metadata,
privateMetadata,
slug: data.slug || slugify(data.name).toLowerCase(),
type: data.type,
type,
});
};