fix form submit bug
This commit is contained in:
@ -62,8 +62,8 @@ const SurveyForm: React.FC<SurveyFormProps> = ({ existingItem }) => {
|
|||||||
...existingItem,
|
...existingItem,
|
||||||
content: existingItem?.content || "Нова анкета",
|
content: existingItem?.content || "Нова анкета",
|
||||||
answers: existingItem?.answers.split(",") || [],
|
answers: existingItem?.answers.split(",") || [],
|
||||||
publicFrom: existingItem?.publicFrom ? dayjs(existingItem.publicFrom).toISOString() : new Date().toISOString(),
|
publicFrom: existingItem?.publicFrom ? dayjs(existingItem.publicFrom).toISOString() : '',
|
||||||
publicUntil: existingItem?.publicUntil ? dayjs(existingItem.publicUntil).toISOString() : new Date().toISOString(),
|
publicUntil: existingItem?.publicUntil ? dayjs(existingItem.publicUntil).toISOString() : null,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ const SurveyForm: React.FC<SurveyFormProps> = ({ existingItem }) => {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//get all publisherIds and create a message for each
|
//get all publisherIds and create a message for each
|
||||||
const messages = pubs.data.map(pub => {
|
const messages = pubs.map(pub => {
|
||||||
return {
|
return {
|
||||||
publisherId: pub.id,
|
publisherId: pub.id,
|
||||||
content: JSON.stringify({ message: item.content, options: item.answers }),
|
content: JSON.stringify({ message: item.content, options: item.answers }),
|
||||||
|
Reference in New Issue
Block a user