chore, fix: don't create invariants from Selector

feat/type-attributes
Tomáš Mládek 2023-07-28 20:19:12 +02:00
parent a8f820d68e
commit 38d52df46a
1 changed files with 9 additions and 13 deletions

View File

@ -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}`);
} }
} }