Skip to content

Commit

Permalink
Fix “waiting” series creation with non-null roles
Browse files Browse the repository at this point in the history
In #a4bff75a314d04e85f7cd977076550a6dfa5373d I added
read- and write-roles to the series API, but forgot to
explicitly set them in the `create/announce` series
mutation. This lead to a deserialization error with
`null` values.

This fix adds the roles as empty arrays.
  • Loading branch information
owi92 committed Jan 24, 2025
1 parent 0de3ca3 commit d70fc26
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/src/api/model/series.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{
acl::{self, Acl},
},
},
db::{types::{SeriesState as State}, util::impl_from_db},
db::{types::SeriesState as State, util::impl_from_db},
model::{Key, ExtraMetadata},
prelude::*,
};
Expand Down Expand Up @@ -114,8 +114,8 @@ impl Series {
pub(crate) async fn create(series: NewSeries, context: &Context) -> ApiResult<Self> {
let selection = Self::select();
let query = format!(
"insert into series (opencast_id, title, state, updated) \
values ($1, $2, 'waiting', '-infinity') \
"insert into series (opencast_id, title, state, updated, read_roles, write_roles) \
values ($1, $2, 'waiting', '-infinity', '{{}}', '{{}}') \
returning {selection}",
);
context.db(context.require_tobira_admin()?)
Expand Down

0 comments on commit d70fc26

Please sign in to comment.