Post identifying strings to Signup
This commit is contained in:
+12
-5
@@ -6,18 +6,25 @@ export interface Signup {
|
||||
id?: number;
|
||||
signupForm_id: number;
|
||||
answer: string;
|
||||
list_name: string;
|
||||
}
|
||||
|
||||
export async function createSignup(data: Signup): Promise<Signup> {
|
||||
try {
|
||||
const resp = await axios.post(url, data, {
|
||||
headers: {
|
||||
"Authorization": getAuthHeader(),
|
||||
},
|
||||
});
|
||||
const resp = await axios.post(url, data);
|
||||
return resp.data;
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
// export async function updateSignup(data: Signup): Promise<Signup> {
|
||||
// try {
|
||||
// const resp = await axios.post(url, data);
|
||||
// return resp.data;
|
||||
// } catch (err) {
|
||||
// console.error(err);
|
||||
// throw err;
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -151,6 +151,7 @@ class SignUpPage extends React.Component<SignUpPageProps, SignUpPageState> {
|
||||
id: undefined,
|
||||
signupForm_id: signUpForm.id,
|
||||
answer: data.formData,
|
||||
list_name: data.formData[signUpForm.questions[0].id]
|
||||
};
|
||||
if (payload.id === undefined) {
|
||||
const resp = await createSignup(payload);
|
||||
|
||||
Reference in New Issue
Block a user