Skip to content

Commit e84b497

Browse files
committed
clenaup
1 parent de89840 commit e84b497

File tree

1 file changed

+12
-6
lines changed
  • backend/custom_admin/src/components/invitation-letter-document-builder

1 file changed

+12
-6
lines changed

backend/custom_admin/src/components/invitation-letter-document-builder/local-state.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ enum ActionType {
3535

3636
const reducer = (state, action) => {
3737
switch (action.type) {
38-
case ActionType.LoadData:
38+
case ActionType.LoadData: {
3939
return {
4040
...action.payload,
4141
__typename: undefined,
@@ -44,7 +44,8 @@ const reducer = (state, action) => {
4444
__typename: undefined,
4545
})),
4646
};
47-
case ActionType.AddPage:
47+
}
48+
case ActionType.AddPage: {
4849
return {
4950
...state,
5051
pages: [
@@ -56,12 +57,14 @@ const reducer = (state, action) => {
5657
},
5758
],
5859
};
59-
case ActionType.RemovePage:
60+
}
61+
case ActionType.RemovePage: {
6062
return {
6163
...state,
6264
pages: state.pages.filter((page) => page.id !== action.payload.pageId),
6365
};
64-
case ActionType.SetContent:
66+
}
67+
case ActionType.SetContent: {
6568
const { pageId, content } = action.payload;
6669
if (pageId === "header" || pageId === "footer") {
6770
return {
@@ -76,7 +79,8 @@ const reducer = (state, action) => {
7679
page.id === pageId ? { ...page, content } : page,
7780
),
7881
};
79-
case ActionType.MovePageUp:
82+
}
83+
case ActionType.MovePageUp: {
8084
const pageIndex = state.pages.findIndex(
8185
(page) => page.id === action.payload.pageId,
8286
);
@@ -94,7 +98,8 @@ const reducer = (state, action) => {
9498
...state,
9599
pages,
96100
};
97-
case ActionType.MovePageDown:
101+
}
102+
case ActionType.MovePageDown: {
98103
const pageIndexDown = state.pages.findIndex(
99104
(page) => page.id === action.payload.pageId,
100105
);
@@ -113,6 +118,7 @@ const reducer = (state, action) => {
113118
...state,
114119
pages: pagesDown,
115120
};
121+
}
116122
}
117123
return state;
118124
};

0 commit comments

Comments
 (0)