chore, fix: don't create invariants from Selector
This commit is contained in:
parent
a8f820d68e
commit
38d52df46a
1 changed files with 9 additions and 13 deletions
|
@ -24,21 +24,17 @@ export async function createLabelled(label: string) {
|
||||||
c: label,
|
c: label,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
const [_, entity] = await api.putEntry(body);
|
||||||
|
return entity;
|
||||||
} else {
|
} else {
|
||||||
// TODO - don't create invariants, create UUIDs instead, maybe with keys?
|
const [_, entity] = await api.putEntry({
|
||||||
body = {
|
entity: {
|
||||||
attribute: ATTR_LABEL,
|
t: "Uuid",
|
||||||
value: {
|
|
||||||
t: "String",
|
|
||||||
c: label,
|
|
||||||
},
|
},
|
||||||
};
|
});
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
await api.putEntityAttribute(entity, ATTR_LABEL, { t: "String", c: label });
|
||||||
const [_, entry] = await api.putEntry(body);
|
|
||||||
return entry;
|
return entity;
|
||||||
} catch (error) {
|
|
||||||
throw new Error(`Failed to create object: ${error}`);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue