diff --git a/backend/src/api/articles.py b/backend/src/api/articles.py index d755cf0..07db99d 100644 --- a/backend/src/api/articles.py +++ b/backend/src/api/articles.py @@ -491,7 +491,8 @@ class InsertComponent(CamelModel): @router.post("/article/component/insert/above") -def insert_component_above(body: InsertComponent): +def insert_component_above(body: InsertComponent, req: Request): + requires_authentication(req) with Database() as db: try: id = insert_component_and_shift_rest_down( @@ -535,7 +536,8 @@ class MoveComponent(CamelModel): @router.put("/article/component/move") -def move_component(body: MoveComponent): +def move_component(body: MoveComponent, req: Request): + requires_authentication(req) with Database() as db: try: cur_order = get_order_from_component_id(db, body.component_id) diff --git a/frontend/src/lib/article/EditMode.svelte b/frontend/src/lib/article/EditMode.svelte index 88dd344..4a9aba7 100644 --- a/frontend/src/lib/article/EditMode.svelte +++ b/frontend/src/lib/article/EditMode.svelte @@ -110,6 +110,7 @@ color="light" on:click={async () => { try { + setToken(); await Backend.moveComponent({ articleId, componentId, @@ -140,6 +141,7 @@ { try { + setToken(); await Backend.insertComponentAbove({ articleId, componentId, @@ -161,6 +163,7 @@ color="light" on:click={async () => { try { + setToken(); await Backend.moveComponent({ articleId, componentId,