Few more form fixes
This commit is contained in:
@@ -6,6 +6,7 @@ import { Question } from "@components/SignupQuestionsWidget";
|
||||
export interface SignupForm {
|
||||
id?: number;
|
||||
title: string;
|
||||
visible: boolean;
|
||||
start_time: string;
|
||||
end_time: string;
|
||||
questions: Question[];
|
||||
|
||||
@@ -105,7 +105,7 @@ class EventCreatePage extends React.Component<EventCreatePageProps, EventCreateP
|
||||
|
||||
try {
|
||||
const payload = data.formData;
|
||||
if (payload.image.startsWith("http")) payload.image = undefined;
|
||||
if (typeof payload.image === "string" && payload.image.startsWith("http")) payload.image = undefined;
|
||||
payload.signup_id = payload.signupForm;
|
||||
payload.tag_id = payload.tags;
|
||||
if (payload.id === undefined) {
|
||||
@@ -211,7 +211,7 @@ class EventCreatePage extends React.Component<EventCreatePageProps, EventCreateP
|
||||
type: ["string", "null"],
|
||||
format: formData.image ? "uri-reference" : "data-url",
|
||||
title: "Override tag icon with image",
|
||||
default: ""
|
||||
default: undefined
|
||||
},
|
||||
finnish_section_divider: {
|
||||
title: "Finnish",
|
||||
|
||||
@@ -133,13 +133,13 @@ class SignupCreatePage extends React.Component<SignupCreatePageProps, SignupCrea
|
||||
visible: {
|
||||
type: "boolean",
|
||||
title: "Visible",
|
||||
default: true,
|
||||
default: false,
|
||||
},
|
||||
quota: {
|
||||
type: ["integer", "null"],
|
||||
type: ["integer"],
|
||||
title: "Quota",
|
||||
minimum: 0,
|
||||
default: null,
|
||||
default: 0,
|
||||
},
|
||||
start_time: {
|
||||
type: "string",
|
||||
|
||||
@@ -26,7 +26,7 @@ const renderList = (signUpForm: SignupForm) => {
|
||||
return (
|
||||
<>
|
||||
<h6>
|
||||
Ilmoittautuneet {signUpForm.quota && (`(${signUpForm.signups.length}/${signUpForm.quota})`)}:
|
||||
Ilmoittautuneet{signUpForm.quota > 0 && (` (${signUpForm.signups.length}/${signUpForm.quota})`)}:
|
||||
</h6>
|
||||
<ol>
|
||||
{signUpForm.signups.map((s, idx) => (
|
||||
|
||||
Reference in New Issue
Block a user