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,
|
||||
},
|
||||
};
|
||||
const [_, entity] = await api.putEntry(body);
|
||||
return entity;
|
||||
} else {
|
||||
// TODO - don't create invariants, create UUIDs instead, maybe with keys?
|
||||
body = {
|
||||
attribute: ATTR_LABEL,
|
||||
value: {
|
||||
t: "String",
|
||||
c: label,
|
||||
const [_, entity] = await api.putEntry({
|
||||
entity: {
|
||||
t: "Uuid",
|
||||
},
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
const [_, entry] = await api.putEntry(body);
|
||||
return entry;
|
||||
} catch (error) {
|
||||
throw new Error(`Failed to create object: ${error}`);
|
||||
await api.putEntityAttribute(entity, ATTR_LABEL, { t: "String", c: label });
|
||||
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue