mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Wrap insert label to make sure they are defined
This commit is contained in:
parent
aa137319b3
commit
c12c995536
1 changed files with 6 additions and 4 deletions
|
|
@ -26,10 +26,12 @@ export const removeDuplicateLabels = mergeMap((x: Label) =>
|
|||
export const insertLabels = async (
|
||||
label: EmbeddedOmnivoreLabel
|
||||
): Promise<EmbeddedOmnivoreLabel> => {
|
||||
await sqlClient.query(
|
||||
'INSERT INTO omnivore.discover_topic_embedding_link(discover_topic_name, embedding_description, embedding) VALUES($1, $2, $3)',
|
||||
[label.label.name, label.label.description, toSql(label.embedding)]
|
||||
)
|
||||
if (label.label.name && label.label.description) {
|
||||
await sqlClient.query(
|
||||
'INSERT INTO omnivore.discover_topic_embedding_link(discover_topic_name, embedding_description, embedding) VALUES($1, $2, $3)',
|
||||
[label.label.name, label.label.description, toSql(label.embedding)]
|
||||
)
|
||||
}
|
||||
return label
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue