ReactJS Error ; {error: 400, reason: “Match failed”, message: “Match failed [400]”, errorType:...
I am trying to send form data into Server but when i click on Next Button ( Wizard Form ) It Give me error. I used Wizard Form and On step 1 when user click on Next Button the form data should send to the server but in meantime it give me error and in Console it warn me ( Undefined User ) :
" {error: 400, reason: "Match failed", message: "Match failed [400]",
errorType: "Meteor.Error"}
Code
import React from 'react';
import 'antd/dist/antd.css';
import './WizarStyle.css';
import styled from 'styled-components';
import { Steps, Form, Button, Card } from 'antd';
import RegisterStepOne from '../RegisterStepOne/RegisterStepOne';
import RegisterStepTwo from '../RegisterStepTwo/RegisterStepTwo';
import RegisterStepThree from '../RegisterStepThree/RegisterStepThree';
import RegisterStepFour from '../RegisterStepFour/RegisterStepFour';
const Step = Steps.Step;
const GeneralText = styled.div`
color: red;
font-size: 26px;
font-weight: 600;
text-align: center;
padding-bottom: 30px;
font-family: Lato;
margin-top: 50px;
color: #012653;
`;
const ButtonWrapper = styled.div`
text-align: center;
margin-top: 26px;
`;
class Wizard extends React.Component {
constructor(props) {
super(props);
this.state = {
current: 0,
// user: null,
};
}
steps = [
{
title: 'General Information',
content: (
<RegisterStepOne
getFieldDecorator={this.props.form.getFieldDecorator}
/>
),
},
{
title: 'Upload Photo',
content: (
<RegisterStepTwo
getFieldDecorator={this.props.form.getFieldDecorator}
/>
),
},
{
title: 'Upload Resume',
content: (
<RegisterStepThree
getFieldDecorator={this.props.form.getFieldDecorator}
/>
),
},
{
title: 'Add Skills',
content: (
<RegisterStepFour
getFieldDecorator={this.props.form.getFieldDecorator}
/>
),
},
];
next() {
this.setState(prevState => ({ current: prevState.current + 1 }));
}
handleSubmit = e => {
e.preventDefault();
this.props.form.validateFieldsAndScroll((err, values) => {
if (!err) {
// this.setState({ user: [this.state.user, values] });
const userOject = {
profile: {
type: 'employee',
screen: 'Step0',
},
...values,
};
fetch('http://138.197.207.41:9000/api/auth/createuser', {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
userOject,
}),
})
.then(response => response.json())
.then(user => {
if (user.error) {
console.warn(user);
} else if (user && user.user) {
console.warn(user);
}
});
}
});
};
prev() {
this.setState(prevState => ({ current: prevState.current - 1 }));
}
getStep = props => this.steps[this.state.current].content;
render() {
const { current } = this.state;
const { getFieldDecorator } = this.props.form;
return (
<Card style={{ borderRadius: 10 }}>
<Form onSubmit={this.handleSubmit}>
<GeneralText>{this.steps[current].title}</GeneralText>
<Steps current={current}>
{this.steps.map((item, index) => (
<Step key={index.toString()} small="small" />
))}
</Steps>
<div className="steps-content">{this.getStep(getFieldDecorator)}</div>
<div className="steps-action">
{' '}
<ButtonWrapper>
{current < this.steps.length - 1 && (
<Button
type="primary"
htmlType="submit"
style={{
background: '#ff9700',
fontWeight: 'bold',
border: 'none',
}}
>
Next
</Button>
)}
{current === this.steps.length - 1 && (
<Button
type="primary"
htmlType="submit"
style={{
background: '#ff9700',
fontWeight: 'bold',
border: 'none',
}}
>
Done
</Button>
)}
{current > 0 && (
<Button
className="preButton"
style={{ marginLeft: 8, border: '1px solid #ff9700' }}
onClick={() => this.prev()}
>
Previous
</Button>
)}
</ButtonWrapper>
</div>
</Form>
</Card>
);
}
}
export default Form.create()(Wizard);
"
javascript reactjs mongodb meteor redux
add a comment |
I am trying to send form data into Server but when i click on Next Button ( Wizard Form ) It Give me error. I used Wizard Form and On step 1 when user click on Next Button the form data should send to the server but in meantime it give me error and in Console it warn me ( Undefined User ) :
" {error: 400, reason: "Match failed", message: "Match failed [400]",
errorType: "Meteor.Error"}
Code
import React from 'react';
import 'antd/dist/antd.css';
import './WizarStyle.css';
import styled from 'styled-components';
import { Steps, Form, Button, Card } from 'antd';
import RegisterStepOne from '../RegisterStepOne/RegisterStepOne';
import RegisterStepTwo from '../RegisterStepTwo/RegisterStepTwo';
import RegisterStepThree from '../RegisterStepThree/RegisterStepThree';
import RegisterStepFour from '../RegisterStepFour/RegisterStepFour';
const Step = Steps.Step;
const GeneralText = styled.div`
color: red;
font-size: 26px;
font-weight: 600;
text-align: center;
padding-bottom: 30px;
font-family: Lato;
margin-top: 50px;
color: #012653;
`;
const ButtonWrapper = styled.div`
text-align: center;
margin-top: 26px;
`;
class Wizard extends React.Component {
constructor(props) {
super(props);
this.state = {
current: 0,
// user: null,
};
}
steps = [
{
title: 'General Information',
content: (
<RegisterStepOne
getFieldDecorator={this.props.form.getFieldDecorator}
/>
),
},
{
title: 'Upload Photo',
content: (
<RegisterStepTwo
getFieldDecorator={this.props.form.getFieldDecorator}
/>
),
},
{
title: 'Upload Resume',
content: (
<RegisterStepThree
getFieldDecorator={this.props.form.getFieldDecorator}
/>
),
},
{
title: 'Add Skills',
content: (
<RegisterStepFour
getFieldDecorator={this.props.form.getFieldDecorator}
/>
),
},
];
next() {
this.setState(prevState => ({ current: prevState.current + 1 }));
}
handleSubmit = e => {
e.preventDefault();
this.props.form.validateFieldsAndScroll((err, values) => {
if (!err) {
// this.setState({ user: [this.state.user, values] });
const userOject = {
profile: {
type: 'employee',
screen: 'Step0',
},
...values,
};
fetch('http://138.197.207.41:9000/api/auth/createuser', {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
userOject,
}),
})
.then(response => response.json())
.then(user => {
if (user.error) {
console.warn(user);
} else if (user && user.user) {
console.warn(user);
}
});
}
});
};
prev() {
this.setState(prevState => ({ current: prevState.current - 1 }));
}
getStep = props => this.steps[this.state.current].content;
render() {
const { current } = this.state;
const { getFieldDecorator } = this.props.form;
return (
<Card style={{ borderRadius: 10 }}>
<Form onSubmit={this.handleSubmit}>
<GeneralText>{this.steps[current].title}</GeneralText>
<Steps current={current}>
{this.steps.map((item, index) => (
<Step key={index.toString()} small="small" />
))}
</Steps>
<div className="steps-content">{this.getStep(getFieldDecorator)}</div>
<div className="steps-action">
{' '}
<ButtonWrapper>
{current < this.steps.length - 1 && (
<Button
type="primary"
htmlType="submit"
style={{
background: '#ff9700',
fontWeight: 'bold',
border: 'none',
}}
>
Next
</Button>
)}
{current === this.steps.length - 1 && (
<Button
type="primary"
htmlType="submit"
style={{
background: '#ff9700',
fontWeight: 'bold',
border: 'none',
}}
>
Done
</Button>
)}
{current > 0 && (
<Button
className="preButton"
style={{ marginLeft: 8, border: '1px solid #ff9700' }}
onClick={() => this.prev()}
>
Previous
</Button>
)}
</ButtonWrapper>
</div>
</Form>
</Card>
);
}
}
export default Form.create()(Wizard);
"
javascript reactjs mongodb meteor redux
add a comment |
I am trying to send form data into Server but when i click on Next Button ( Wizard Form ) It Give me error. I used Wizard Form and On step 1 when user click on Next Button the form data should send to the server but in meantime it give me error and in Console it warn me ( Undefined User ) :
" {error: 400, reason: "Match failed", message: "Match failed [400]",
errorType: "Meteor.Error"}
Code
import React from 'react';
import 'antd/dist/antd.css';
import './WizarStyle.css';
import styled from 'styled-components';
import { Steps, Form, Button, Card } from 'antd';
import RegisterStepOne from '../RegisterStepOne/RegisterStepOne';
import RegisterStepTwo from '../RegisterStepTwo/RegisterStepTwo';
import RegisterStepThree from '../RegisterStepThree/RegisterStepThree';
import RegisterStepFour from '../RegisterStepFour/RegisterStepFour';
const Step = Steps.Step;
const GeneralText = styled.div`
color: red;
font-size: 26px;
font-weight: 600;
text-align: center;
padding-bottom: 30px;
font-family: Lato;
margin-top: 50px;
color: #012653;
`;
const ButtonWrapper = styled.div`
text-align: center;
margin-top: 26px;
`;
class Wizard extends React.Component {
constructor(props) {
super(props);
this.state = {
current: 0,
// user: null,
};
}
steps = [
{
title: 'General Information',
content: (
<RegisterStepOne
getFieldDecorator={this.props.form.getFieldDecorator}
/>
),
},
{
title: 'Upload Photo',
content: (
<RegisterStepTwo
getFieldDecorator={this.props.form.getFieldDecorator}
/>
),
},
{
title: 'Upload Resume',
content: (
<RegisterStepThree
getFieldDecorator={this.props.form.getFieldDecorator}
/>
),
},
{
title: 'Add Skills',
content: (
<RegisterStepFour
getFieldDecorator={this.props.form.getFieldDecorator}
/>
),
},
];
next() {
this.setState(prevState => ({ current: prevState.current + 1 }));
}
handleSubmit = e => {
e.preventDefault();
this.props.form.validateFieldsAndScroll((err, values) => {
if (!err) {
// this.setState({ user: [this.state.user, values] });
const userOject = {
profile: {
type: 'employee',
screen: 'Step0',
},
...values,
};
fetch('http://138.197.207.41:9000/api/auth/createuser', {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
userOject,
}),
})
.then(response => response.json())
.then(user => {
if (user.error) {
console.warn(user);
} else if (user && user.user) {
console.warn(user);
}
});
}
});
};
prev() {
this.setState(prevState => ({ current: prevState.current - 1 }));
}
getStep = props => this.steps[this.state.current].content;
render() {
const { current } = this.state;
const { getFieldDecorator } = this.props.form;
return (
<Card style={{ borderRadius: 10 }}>
<Form onSubmit={this.handleSubmit}>
<GeneralText>{this.steps[current].title}</GeneralText>
<Steps current={current}>
{this.steps.map((item, index) => (
<Step key={index.toString()} small="small" />
))}
</Steps>
<div className="steps-content">{this.getStep(getFieldDecorator)}</div>
<div className="steps-action">
{' '}
<ButtonWrapper>
{current < this.steps.length - 1 && (
<Button
type="primary"
htmlType="submit"
style={{
background: '#ff9700',
fontWeight: 'bold',
border: 'none',
}}
>
Next
</Button>
)}
{current === this.steps.length - 1 && (
<Button
type="primary"
htmlType="submit"
style={{
background: '#ff9700',
fontWeight: 'bold',
border: 'none',
}}
>
Done
</Button>
)}
{current > 0 && (
<Button
className="preButton"
style={{ marginLeft: 8, border: '1px solid #ff9700' }}
onClick={() => this.prev()}
>
Previous
</Button>
)}
</ButtonWrapper>
</div>
</Form>
</Card>
);
}
}
export default Form.create()(Wizard);
"
javascript reactjs mongodb meteor redux
I am trying to send form data into Server but when i click on Next Button ( Wizard Form ) It Give me error. I used Wizard Form and On step 1 when user click on Next Button the form data should send to the server but in meantime it give me error and in Console it warn me ( Undefined User ) :
" {error: 400, reason: "Match failed", message: "Match failed [400]",
errorType: "Meteor.Error"}
Code
import React from 'react';
import 'antd/dist/antd.css';
import './WizarStyle.css';
import styled from 'styled-components';
import { Steps, Form, Button, Card } from 'antd';
import RegisterStepOne from '../RegisterStepOne/RegisterStepOne';
import RegisterStepTwo from '../RegisterStepTwo/RegisterStepTwo';
import RegisterStepThree from '../RegisterStepThree/RegisterStepThree';
import RegisterStepFour from '../RegisterStepFour/RegisterStepFour';
const Step = Steps.Step;
const GeneralText = styled.div`
color: red;
font-size: 26px;
font-weight: 600;
text-align: center;
padding-bottom: 30px;
font-family: Lato;
margin-top: 50px;
color: #012653;
`;
const ButtonWrapper = styled.div`
text-align: center;
margin-top: 26px;
`;
class Wizard extends React.Component {
constructor(props) {
super(props);
this.state = {
current: 0,
// user: null,
};
}
steps = [
{
title: 'General Information',
content: (
<RegisterStepOne
getFieldDecorator={this.props.form.getFieldDecorator}
/>
),
},
{
title: 'Upload Photo',
content: (
<RegisterStepTwo
getFieldDecorator={this.props.form.getFieldDecorator}
/>
),
},
{
title: 'Upload Resume',
content: (
<RegisterStepThree
getFieldDecorator={this.props.form.getFieldDecorator}
/>
),
},
{
title: 'Add Skills',
content: (
<RegisterStepFour
getFieldDecorator={this.props.form.getFieldDecorator}
/>
),
},
];
next() {
this.setState(prevState => ({ current: prevState.current + 1 }));
}
handleSubmit = e => {
e.preventDefault();
this.props.form.validateFieldsAndScroll((err, values) => {
if (!err) {
// this.setState({ user: [this.state.user, values] });
const userOject = {
profile: {
type: 'employee',
screen: 'Step0',
},
...values,
};
fetch('http://138.197.207.41:9000/api/auth/createuser', {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
userOject,
}),
})
.then(response => response.json())
.then(user => {
if (user.error) {
console.warn(user);
} else if (user && user.user) {
console.warn(user);
}
});
}
});
};
prev() {
this.setState(prevState => ({ current: prevState.current - 1 }));
}
getStep = props => this.steps[this.state.current].content;
render() {
const { current } = this.state;
const { getFieldDecorator } = this.props.form;
return (
<Card style={{ borderRadius: 10 }}>
<Form onSubmit={this.handleSubmit}>
<GeneralText>{this.steps[current].title}</GeneralText>
<Steps current={current}>
{this.steps.map((item, index) => (
<Step key={index.toString()} small="small" />
))}
</Steps>
<div className="steps-content">{this.getStep(getFieldDecorator)}</div>
<div className="steps-action">
{' '}
<ButtonWrapper>
{current < this.steps.length - 1 && (
<Button
type="primary"
htmlType="submit"
style={{
background: '#ff9700',
fontWeight: 'bold',
border: 'none',
}}
>
Next
</Button>
)}
{current === this.steps.length - 1 && (
<Button
type="primary"
htmlType="submit"
style={{
background: '#ff9700',
fontWeight: 'bold',
border: 'none',
}}
>
Done
</Button>
)}
{current > 0 && (
<Button
className="preButton"
style={{ marginLeft: 8, border: '1px solid #ff9700' }}
onClick={() => this.prev()}
>
Previous
</Button>
)}
</ButtonWrapper>
</div>
</Form>
</Card>
);
}
}
export default Form.create()(Wizard);
"
javascript reactjs mongodb meteor redux
javascript reactjs mongodb meteor redux
asked Nov 26 '18 at 12:07
BradBrad
3318
3318
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
This is a server error, it means your parameters didn't match the check
function.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53480784%2freactjs-error-error-400-reason-match-failed-message-match-failed-400%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This is a server error, it means your parameters didn't match the check
function.
add a comment |
This is a server error, it means your parameters didn't match the check
function.
add a comment |
This is a server error, it means your parameters didn't match the check
function.
This is a server error, it means your parameters didn't match the check
function.
answered Nov 27 '18 at 6:18
FawziFawzi
267110
267110
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53480784%2freactjs-error-error-400-reason-match-failed-message-match-failed-400%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown