chore: upgrade to SvelteKit 2.0

This commit is contained in:
2023-12-15 08:33:16 +10:00
parent 892934f580
commit 323045a940
20 changed files with 257 additions and 226 deletions

View File

@@ -73,7 +73,7 @@ export const load = async ({ params, setHeaders }) => {
const { data: { location: location, photos, total_published, product } } = res
if (!location.length || location.length && params.country !== location[0].country.slug) {
throw error(404, 'This location is not available… yet!')
error(404, 'This location is not available… yet!')
}
setHeaders({ 'Cache-Control': 'public, max-age=1, stale-while-revalidate=604799' })
@@ -85,6 +85,6 @@ export const load = async ({ params, setHeaders }) => {
product: product[0],
}
} catch (err) {
throw error(500, err.message)
error(500, err.message)
}
}

View File

@@ -95,7 +95,7 @@
// Return new photos
return photos
} else {
throw new Error('Error while loading new photos')
new Error('Error while loading new photos')
}
}

View File

@@ -86,6 +86,6 @@ export const load = async ({ params, setHeaders }) => {
}
}
} catch (err) {
throw error(500, err.message)
error(500, err.message)
}
}

View File

@@ -209,7 +209,7 @@
}
}
} else {
throw new Error('Error while loading new photos')
new Error('Error while loading new photos')
}
}