Rename methods to match HTTP requests
This commit is contained in:
@@ -2,7 +2,7 @@ import type { RequestEvent, RequestHandlerOutput } from '@sveltejs/kit'
|
||||
|
||||
|
||||
// Block GET requests
|
||||
export async function get({}: RequestEvent): Promise<RequestHandlerOutput> {
|
||||
export async function GET ({}: RequestEvent): Promise<RequestHandlerOutput> {
|
||||
return {
|
||||
status: 403,
|
||||
body: 'nope!'
|
||||
@@ -13,7 +13,7 @@ export async function get({}: RequestEvent): Promise<RequestHandlerOutput> {
|
||||
/**
|
||||
* POST request
|
||||
*/
|
||||
export async function post ({ request }: RequestEvent): Promise<RequestHandlerOutput> {
|
||||
export async function POST ({ request }: RequestEvent): Promise<RequestHandlerOutput> {
|
||||
const body = await request.text()
|
||||
|
||||
if (body) {
|
||||
|
||||
Reference in New Issue
Block a user