Skip to content

Commit

Permalink
Remove link_load_options logic (#28)
Browse files Browse the repository at this point in the history
* feat: handle `callback` option

* feat: add simple input string in metadata

* feat: add generic link options

* fix: remove `link_load_options` usage, handled server side

* chore: revert metadata changes
  • Loading branch information
stefanorosanelli authored Nov 27, 2024
1 parent b34a3c9 commit 8093689
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions components/Form/ChatbotLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ if (props.item.cmetadata) {
const statesStore = useStatesStore();
const collectionUuid = statesStore.collection?.uuid || '';
const metadataDefaults = statesStore.collection?.cmetadata?.metadata_defaults?.links || {};
const linkLoadOptions = statesStore.collection?.cmetadata?.link_load_options || [];
const integration = useIntegration();
const indexingResult = ref<'Indexed' | 'Not Indexed' | 'None'>('None');
Expand Down Expand Up @@ -138,7 +137,6 @@ const create = async () => {
link: url.value,
collection_id: collectionUuid,
metadata: { ...metadata, ...metadataDefaults },
options: linkOptions(url.value),
},
});
} catch (err) {
Expand All @@ -147,16 +145,6 @@ const create = async () => {
}
};
const linkOptions = (url: string) => {
let selector: any = linkLoadOptions.find((o: any) => o.url === url)?.selector;
if (selector) {
return { selector };
}
selector = linkLoadOptions.find((o: any) => url.startsWith(o.url))?.selector;
return selector ? { selector } : {};
};
const deleteLink = async () => {
isDeleting.value = true;
try {
Expand All @@ -183,7 +171,6 @@ const reindexLink = async (item: Record<string, any>, collection: string | undef
link: url,
collection_id: collection,
metadata: metadata,
options: linkOptions(url),
document_id: document_id,
},
});
Expand Down

0 comments on commit 8093689

Please sign in to comment.