values set only a for few inputType (#2355)
This commit is contained in:
parent
f349bbc86a
commit
e7a7b79f3e
1 changed files with 9 additions and 2 deletions
|
@ -3,9 +3,16 @@ export function createAttribute({
|
||||||
attributeValues = ["value"],
|
attributeValues = ["value"],
|
||||||
type = "PRODUCT_TYPE",
|
type = "PRODUCT_TYPE",
|
||||||
inputType = "DROPDOWN",
|
inputType = "DROPDOWN",
|
||||||
filterableInDashboard = false
|
filterableInDashboard = false,
|
||||||
|
values = [],
|
||||||
}) {
|
}) {
|
||||||
const values = attributeValues.map(element => `{name:"${element}"}`);
|
if (
|
||||||
|
inputType === "MULTISELECT" ||
|
||||||
|
inputType === "DROPDOWN" ||
|
||||||
|
inputType === "SWATCH"
|
||||||
|
) {
|
||||||
|
values = attributeValues.map(element => `{name:"${element}"}`);
|
||||||
|
}
|
||||||
const mutation = `mutation{
|
const mutation = `mutation{
|
||||||
attributeCreate(input:{
|
attributeCreate(input:{
|
||||||
name:"${name}"
|
name:"${name}"
|
||||||
|
|
Loading…
Reference in a new issue