Skip to content

Commit

Permalink
Fix users not being able to edit content (#834)
Browse files Browse the repository at this point in the history
Fixes #832
  • Loading branch information
LukasKalbertodt committed May 15, 2023
2 parents 93e8514 + aba206a commit 23a1152
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/src/api/model/block/mutations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ impl BlockValue {
and type = 'title' \
returning {selection}",
);
context.db(context.require_moderator()?)
context.db
.query_one(&query, &[&Self::key_for(id)?, &set.content])
.await?
.pipe(|row| Ok(Self::from_row_start(&row)))
Expand All @@ -251,7 +251,7 @@ impl BlockValue {
and type = 'text' \
returning {selection}",
);
context.db(context.require_moderator()?)
context.db
.query_one(&query, &[&Self::key_for(id)?, &set.content])
.await?
.pipe(|row| Ok(Self::from_row_start(&row)))
Expand Down Expand Up @@ -287,7 +287,7 @@ impl BlockValue {
&set.show_title,
&set.show_metadata,
];
context.db(context.require_moderator()?)
context.db
.query_one(&query, &args)
.await?
.pipe(|row| Ok(Self::from_row_start(&row)))
Expand All @@ -314,7 +314,7 @@ impl BlockValue {
and type = 'video' \
returning {selection}",
);
context.db(context.require_moderator()?)
context.db
.query_one(&query, &[&Self::key_for(id)?, &video_id, &set.show_title])
.await?
.pipe(|row| Ok(Self::from_row_start(&row)))
Expand Down

0 comments on commit 23a1152

Please sign in to comment.