Skip to content

Commit

Permalink
fix: lock behind auth
Browse files Browse the repository at this point in the history
  • Loading branch information
xnought committed Apr 21, 2024
1 parent e0a2268 commit 10dab48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/src/api/articles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/lib/article/EditMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
color="light"
on:click={async () => {
try {
setToken();
await Backend.moveComponent({
articleId,
componentId,
Expand Down Expand Up @@ -140,6 +141,7 @@
<DropdownItem
on:click={async () => {
try {
setToken();
await Backend.insertComponentAbove({
articleId,
componentId,
Expand All @@ -161,6 +163,7 @@
color="light"
on:click={async () => {
try {
setToken();
await Backend.moveComponent({
articleId,
componentId,
Expand Down

0 comments on commit 10dab48

Please sign in to comment.