mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-29 17:59:36 +02:00
feat: Fetch categories and check for Immich integration on modal mount
This commit is contained in:
parent
577eb9cceb
commit
16fc9bc70e
1 changed files with 16 additions and 0 deletions
|
@ -89,6 +89,22 @@
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
modal = document.getElementById('my_modal_1') as HTMLDialogElement;
|
modal = document.getElementById('my_modal_1') as HTMLDialogElement;
|
||||||
modal.showModal();
|
modal.showModal();
|
||||||
|
let categoryFetch = await fetch('/api/categories/categories');
|
||||||
|
if (categoryFetch.ok) {
|
||||||
|
categories = await categoryFetch.json();
|
||||||
|
} else {
|
||||||
|
addToast('error', $t('adventures.category_fetch_error'));
|
||||||
|
}
|
||||||
|
// Check for Immich Integration
|
||||||
|
let res = await fetch('/api/integrations');
|
||||||
|
if (!res.ok) {
|
||||||
|
addToast('error', $t('immich.integration_fetch_error'));
|
||||||
|
} else {
|
||||||
|
let data = await res.json();
|
||||||
|
if (data.immich) {
|
||||||
|
immichIntegration = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let url: string = '';
|
let url: string = '';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue