Skip to content

Commit

Permalink
fix: use default value
Browse files Browse the repository at this point in the history
  • Loading branch information
timthedev07 committed Jan 10, 2024
1 parent 137c6e8 commit 996dc3b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/src/components/forms/QuestionForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,17 @@ export const QuestionForm: FC<QuestionFormProps> = ({
const [formData, setFormData] = useState<FormData>(() => {
if (defaultValues && operationType === "update") {
const { files: _, ...rest } = defaultValues;
return rest;
return {
...rest,
content: rest.content.length
? rest.content
: "Please see the attachments for the question that I have, thank you!",
};
} else {
return {
title: "",
content: "",
content:
"Please see the attachments for the question that I have, thank you!",
categories: [],
anonymous: false,
};
Expand Down

0 comments on commit 996dc3b

Please sign in to comment.