u
This commit is contained in:
@@ -371,9 +371,14 @@ const categorySlice = createSlice({
|
||||
.addCase(moveCategory.fulfilled, (state, action) => {
|
||||
const moved = action.payload;
|
||||
if (moved == null || state.categories == null) return;
|
||||
const existing = state.categories[String(moved.id)] ?? {};
|
||||
// Der Move-Response enthält nur { id, parentId, sort } — keinen Namen.
|
||||
// parentId/sort werden übernommen, der bestehende Name bleibt erhalten
|
||||
// (das Backend hat ihn beim Move nicht verändert).
|
||||
state.categories[String(moved.id)] = {
|
||||
...(state.categories[String(moved.id)] ?? {}),
|
||||
...moved,
|
||||
...existing,
|
||||
parentId: moved.parentId,
|
||||
sort: moved.sort,
|
||||
};
|
||||
})
|
||||
.addCase(createArticle.fulfilled, (state, action) => {
|
||||
|
||||
Reference in New Issue
Block a user