Skip to content

Commit

Permalink
Fix empty name error
Browse files Browse the repository at this point in the history
It is allowed to mount series in Tobira without providing a name
in the UI. That makes sense since that is always overridden by
the series name (after storing it in the DB).

But leaving out the name would lead to a DB error before its overridden,
since an empty string was passed and rust doesn't infer that as `null`
(in which case it would be overridden like it should).
Passing `null` instead of an empty string fixes this.
  • Loading branch information
owi92 committed Aug 12, 2024
1 parent f7bda1a commit eb18e6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/slices/seriesSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export const postNewSeries = createAppAsyncThunk('series/postNewSeries', async (
values.breadcrumbs.concat(values.selectedPage).forEach( function (page: TobiraPage) {
if (page.new) {
newPages.push({
name: page.title,
name: page.title !== "" ? page.title : null,
pathSegment: page.segment,
});
} else {
Expand Down

0 comments on commit eb18e6e

Please sign in to comment.