mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge pull request #2031 from appwrite/fix-endpoint-sites-screenshots
Fix: Use correct endpoint for site screenshots
This commit is contained in:
@@ -81,7 +81,8 @@ function createConsoleSdk(client: Client) {
|
||||
billing: new Billing(client),
|
||||
sources: new Sources(client),
|
||||
sites: new Sites(client),
|
||||
domains: new Domains(client)
|
||||
domains: new Domains(client),
|
||||
storage: new Storage(client)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -20,9 +20,8 @@
|
||||
import { app } from '$lib/stores/app';
|
||||
import { base } from '$app/paths';
|
||||
import { isCloud } from '$lib/system';
|
||||
import { getApiEndpoint } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { capitalize } from '$lib/helpers/string';
|
||||
import { page } from '$app/state';
|
||||
|
||||
export let deployment: Models.Deployment;
|
||||
export let proxyRuleList: Models.ProxyRuleList;
|
||||
@@ -46,9 +45,7 @@
|
||||
}
|
||||
|
||||
function getFilePreview(fileId: string) {
|
||||
// TODO: @Meldiron use sdk.forConsole.storage.getFilePreview
|
||||
const endpoint = getApiEndpoint(page.params.region);
|
||||
return endpoint + `/storage/buckets/screenshots/files/${fileId}/view?project=console`;
|
||||
return sdk.forConsole.storage.getFileView('screenshots', fileId);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { generateSiteDeploymentDesc } from './store';
|
||||
import { SvgIcon } from '$lib/components';
|
||||
import { app } from '$lib/stores/app';
|
||||
import { getApiEndpoint } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import AddCollaboratorModal from './(components)/addCollaboratorModal.svelte';
|
||||
import SitesActionMenu from './sitesActionMenu.svelte';
|
||||
import { capitalize } from '$lib/helpers/string';
|
||||
@@ -33,9 +33,7 @@
|
||||
}
|
||||
|
||||
function getFilePreview(fileId: string) {
|
||||
// TODO: @Meldiron use sdk.forConsole.storage.getFilePreview
|
||||
const endpoint = getApiEndpoint(page.params.region);
|
||||
return endpoint + `/storage/buckets/screenshots/files/${fileId}/view?project=console`;
|
||||
return sdk.forConsole.storage.getFileView('screenshots', fileId);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user