Skip to content

Commit

Permalink
Document http verbs to actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Zokhoi committed Sep 12, 2023
1 parent c9eb28f commit 7cd9d21
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions framerail/src/routes/[slug]/[...extra]/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { pageDelete } from "$lib/server/page/delete"
import { pageEdit } from "$lib/server/page/edit"
import { pageMove } from "$lib/server/page/move"

/**
* Edit or create page.
*/
export async function POST(event) {
let data = await event.request.formData()
let slug = event.params.slug
Expand Down Expand Up @@ -31,6 +34,9 @@ export async function POST(event) {
return new Response(JSON.stringify(res))
}

/**
* Delete page.
*/
export async function DELETE(event) {
let data = await event.request.formData()
let slug = event.params.slug
Expand All @@ -44,6 +50,9 @@ export async function DELETE(event) {
return new Response(JSON.stringify(res))
}

/**
* Move page to new slug.
*/
export async function PUT(event) {
let data = await event.request.formData()
let slug = event.params.slug
Expand Down

0 comments on commit 7cd9d21

Please sign in to comment.