diff --git a/src/routes/[country]/[location]/[photo].ts b/src/routes/[country]/[location]/[photo].ts index df4e827..6f9ed39 100644 --- a/src/routes/[country]/[location]/[photo].ts +++ b/src/routes/[country]/[location]/[photo].ts @@ -1,7 +1,7 @@ import type { RequestEvent, RequestHandlerOutput } from '@sveltejs/kit' import { fetchAPI } from '$utils/api' -export async function get({ params }: RequestEvent): Promise { +export async function GET ({ params }: RequestEvent): Promise { try { // Get the first photo ID const firstPhoto = await fetchAPI(` diff --git a/src/routes/[country]/[location]/index.ts b/src/routes/[country]/[location]/index.ts index bbd1986..1ba01cf 100644 --- a/src/routes/[country]/[location]/index.ts +++ b/src/routes/[country]/[location]/index.ts @@ -14,7 +14,7 @@ export const photoFields = ` date_created ` -export async function get({ params }: RequestEvent): Promise { +export async function GET ({ params }: RequestEvent): Promise { try { const { location: slug } = params diff --git a/src/routes/api/newsletter.ts b/src/routes/api/newsletter.ts index df050ce..2292a75 100644 --- a/src/routes/api/newsletter.ts +++ b/src/routes/api/newsletter.ts @@ -2,7 +2,7 @@ import type { RequestEvent, RequestHandlerOutput } from '@sveltejs/kit' // Block GET requests -export async function get({}: RequestEvent): Promise { +export async function GET ({}: RequestEvent): Promise { return { status: 403, body: 'nope!' @@ -13,7 +13,7 @@ export async function get({}: RequestEvent): Promise { /** * POST request */ -export async function post ({ request }: RequestEvent): Promise { +export async function POST ({ request }: RequestEvent): Promise { const body = await request.text() if (body) { diff --git a/src/routes/api/swell.ts b/src/routes/api/swell.ts index 7e941a1..15018f2 100644 --- a/src/routes/api/swell.ts +++ b/src/routes/api/swell.ts @@ -11,7 +11,7 @@ import { // Block GET requests -export async function get({}: RequestEvent): Promise { +export async function GET ({}: RequestEvent): Promise { return { status: 403, body: 'nope!' @@ -22,7 +22,7 @@ export async function get({}: RequestEvent): Promise { /** * POST request */ -export async function post ({ request }: RequestEvent): Promise { +export async function POST ({ request }: RequestEvent): Promise { try { const body = await request.json() const { action, cartId, productId } = body diff --git a/src/routes/credits.ts b/src/routes/credits.ts index 5e7fab9..5e4267c 100644 --- a/src/routes/credits.ts +++ b/src/routes/credits.ts @@ -1,7 +1,7 @@ import type { RequestEvent, RequestHandlerOutput } from '@sveltejs/kit' import { fetchAPI } from '$utils/api' -export async function get({}: RequestEvent): Promise { +export async function GET ({}: RequestEvent): Promise { try { const res = await fetchAPI(` query { diff --git a/src/routes/index.ts b/src/routes/index.ts index ed34d16..fb659cf 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -2,7 +2,7 @@ import type { RequestEvent, RequestHandlerOutput } from '@sveltejs/kit' import { fetchAPI } from '$utils/api' import { getRandomItems } from '$utils/functions' -export async function get({}: RequestEvent): Promise { +export async function GET ({}: RequestEvent): Promise { try { // Get total of published photos const totalRes = await fetchAPI(` diff --git a/src/routes/photos.ts b/src/routes/photos.ts index ee5c010..82ad0cc 100644 --- a/src/routes/photos.ts +++ b/src/routes/photos.ts @@ -5,7 +5,7 @@ import { fetchAPI } from '$utils/api' const defaultCountry = String(import.meta.env.VITE_FILTERS_DEFAULT_COUNTRY) const defaultSort = String(import.meta.env.VITE_FILTERS_DEFAULT_SORT) -export async function get({ url }: RequestEvent): Promise { +export async function GET ({ url }: RequestEvent): Promise { try { // Query parameters const queryCountry = url.searchParams.get('country') || defaultCountry diff --git a/src/routes/shop/[type]-[name].ts b/src/routes/shop/[type]-[name].ts index ab3c55e..292640b 100644 --- a/src/routes/shop/[type]-[name].ts +++ b/src/routes/shop/[type]-[name].ts @@ -2,7 +2,7 @@ import type { RequestEvent, RequestHandlerOutput } from '@sveltejs/kit' import { fetchAPI } from '$utils/api' import { getProduct } from '$utils/functions/swell' -export async function get({ params }: RequestEvent): Promise { +export async function GET ({ params }: RequestEvent): Promise { try { // Get content from API const data = await fetchAPI(` diff --git a/src/routes/shop/index.ts b/src/routes/shop/index.ts index 8b731b0..132b161 100644 --- a/src/routes/shop/index.ts +++ b/src/routes/shop/index.ts @@ -3,7 +3,7 @@ import { fetchAPI } from '$utils/api' import { getRandomItem } from '$utils/functions' import { getProduct } from '$utils/functions/swell' -export async function get({}: RequestEvent): Promise { +export async function GET ({}: RequestEvent): Promise { try { // Get content from API const data = await fetchAPI(` diff --git a/src/routes/subscribe.ts b/src/routes/subscribe.ts index b445552..f1cf462 100644 --- a/src/routes/subscribe.ts +++ b/src/routes/subscribe.ts @@ -1,7 +1,7 @@ import type { RequestEvent, RequestHandlerOutput } from '@sveltejs/kit' import { fetchAPI } from '$utils/api' -export async function get({}: RequestEvent): Promise { +export async function GET({}: RequestEvent): Promise { try { const res = await fetchAPI(` query {