Fixes here and there
This commit is contained in:
@@ -1,12 +1,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import SiteTitle from '$components/atoms/SiteTitle.svelte'
|
||||||
import SiteTitle from '$components/atoms/SiteTitle.svelte';
|
|
||||||
|
|
||||||
export let text: string
|
export let text: string
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section class="heading">
|
<section class="heading">
|
||||||
<SiteTitle variant="inline" />
|
<SiteTitle variant="inline" />
|
||||||
<p class="text-medium">{text}</p>
|
|
||||||
|
<p class="text-medium">
|
||||||
|
{text}
|
||||||
|
</p>
|
||||||
</section>
|
</section>
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
const apiURL: string = process.env.NODE_ENV === 'development'
|
// Define API URL from environment
|
||||||
|
export const API_URL = import.meta.env.MODE === 'development'
|
||||||
? `${import.meta.env.VITE_API_URL_DEV}`
|
? `${import.meta.env.VITE_API_URL_DEV}`
|
||||||
: `${import.meta.env.VITE_API_URL_PROD}`
|
: `${import.meta.env.VITE_API_URL_PROD}`
|
||||||
|
|
||||||
@@ -8,7 +9,7 @@ const apiURL: string = process.env.NODE_ENV === 'development'
|
|||||||
*/
|
*/
|
||||||
export const fetchAPI = async (query: string) => {
|
export const fetchAPI = async (query: string) => {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`${apiURL}${import.meta.env.VITE_API_GRAPHQL_PATH}`, {
|
const res = await fetch(`${API_URL}${import.meta.env.VITE_API_GRAPHQL_PATH}`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
import { API_URL } from '$utils/api'
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a Directus asset URL from parameters
|
* Get a Directus asset URL from parameters
|
||||||
*/
|
*/
|
||||||
@@ -15,5 +18,5 @@ export const getAssetUrl = (
|
|||||||
if (quality) args += `&quality=${quality}`
|
if (quality) args += `&quality=${quality}`
|
||||||
if (format) args += `&format=${format}`
|
if (format) args += `&format=${format}`
|
||||||
|
|
||||||
return `${import.meta.env.VITE_API_URL_DEV}/assets/${id}?width=${width}&height=${height}&fit=${fit}${args}`
|
return `${API_URL}/assets/${id}?width=${width}&height=${height}&fit=${fit}${args}`
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user