Form field fixes
This commit is contained in:
@@ -98,11 +98,7 @@ class EventCreatePage extends React.Component<EventCreatePageProps, EventCreateP
|
||||
}
|
||||
|
||||
onSubmit = async (data) => {
|
||||
console.log("submitted, data:");
|
||||
console.log(data.formData);
|
||||
|
||||
const { history } = this.props;
|
||||
|
||||
try {
|
||||
const payload = data.formData;
|
||||
if (typeof payload.image === "string" && payload.image.startsWith("http")) payload.image = undefined;
|
||||
@@ -134,6 +130,7 @@ class EventCreatePage extends React.Component<EventCreatePageProps, EventCreateP
|
||||
|
||||
onError = (data) => {
|
||||
console.error("error, data:");
|
||||
console.log(this.state.formData);
|
||||
console.log(data);
|
||||
}
|
||||
|
||||
@@ -197,10 +194,10 @@ class EventCreatePage extends React.Component<EventCreatePageProps, EventCreateP
|
||||
default: tomorrowDatetime,
|
||||
},
|
||||
signupForm: {
|
||||
type: ["array"],
|
||||
type: "array",
|
||||
title: "Signup forms",
|
||||
items: {
|
||||
type: ["number", "null"],
|
||||
type: "number",
|
||||
// TODO: A bug here, DB must have at least one SignupForm, otherwise cannot submit
|
||||
enum: signupForm.map(form => form.id),
|
||||
enumNames: signupForm.map(form => form.title),
|
||||
|
||||
@@ -44,7 +44,7 @@ class SignupCreatePage extends React.Component<SignupCreatePageProps, SignupCrea
|
||||
|
||||
fetchInitialFormData = async (id: number) => {
|
||||
try {
|
||||
const data = await getForm(id);
|
||||
const data = await getForm(id, true);
|
||||
this.setState({
|
||||
formData: {
|
||||
...data,
|
||||
|
||||
Reference in New Issue
Block a user