Skip to content

Commit 6f737cc

Browse files
committed
fix: JSON error crashing editor and language question options - question options mismatch
1 parent 4d4ec8b commit 6f737cc

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

  • packages
    • ilmomasiina-backend/src/models
    • ilmomasiina-frontend/src/components/FieldRow

packages/ilmomasiina-backend/src/models/event.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export class Event extends Model<EventManualAttributes, EventCreationAttributes>
147147
}
148148
// Remove options if the question does not have them.
149149
if (!question.options) {
150-
localizedQuestion.options = null;
150+
localizedQuestion.options = [];
151151
}
152152
}
153153
}

packages/ilmomasiina-frontend/src/components/FieldRow/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default function FieldRow<C extends As>({
8989
...config,
9090
});
9191
const error = submitError || validationError;
92-
const formattedError = invalid && (formatError ? formatError(error) : error);
92+
const formattedError = invalid && (formatError ? formatError(error) : JSON.stringify(error));
9393

9494
let field: ReactNode;
9595
if (children) {

0 commit comments

Comments
 (0)