Skip to content

Commit

Permalink
fix card position
Browse files Browse the repository at this point in the history
  • Loading branch information
rumizz committed Dec 29, 2024
1 parent 0181b43 commit d1bca35
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/pages/compose/ComposePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ const ComposePage: FC = () => {
reset();
setItems((draft) => {
data.exerciseSheet?.sheetItems?.forEach((item) => {
item.exercises.forEach((exercise, i) => {
item.exercises.forEach((exercise) => {
const key = `${item.ageGroup}-${item.level}`;
if (!draft[key]) {
return;
}
draft[key][i] = {
draft[key][exercise.order] = {
id: exercise.exercise.id,
cardId: uniqueId(),
};
Expand Down Expand Up @@ -91,11 +91,11 @@ const ComposePage: FC = () => {
ageGroup: ageGroup as ExerciseAgeGroup,
level: parseInt(level),
exercises: exercises
.filter((x) => x.id)
.map((item, i) => ({
exerciseID: item.id! as string,
exerciseID: item.id ? item.id.toString() : "",
order: i,
})),
}))
.filter((x) => x.exerciseID && x.exerciseID.length > 0),
});
});
await mutate({
Expand Down

0 comments on commit d1bca35

Please sign in to comment.