Commit be7b204c authored by Khalid Ali's avatar Khalid Ali
Browse files

Alter axios form submitting

parent 13b34980
.DS_Store
node_modules
/dist
cockroach-data/*
/tests/e2e/reports/
selenium-debug.log
......
......@@ -3,10 +3,6 @@ const https = require('https');
export default axios.create({
baseURL: `https://localhost:9090/bs/api/`,
httpsAgent: new https.Agent({
rejectUnauthorized: false
}),
headers: {
'Access-Control-Allow-Origin': 'login.gmu.edu',
},
});
\ No newline at end of file
......@@ -151,26 +151,9 @@ export default class CreateListing extends Vue {
private onSubmit(evt: Event) {
evt.preventDefault();
const data = new FormData();
data.append('isbn', this.form.isbn);
data.append('course', this.form.course);
data.append('condition', this.form.condition.toString());
data.append('accessCode', this.form.accessCode.toString());
data.append('price', this.form.price.toString());
data.append('description', this.form.description);
for (let i: number = 0; i < this.form.photo.length; i++) {
data.append('photo' + i.toString(), this.form.photo[i]);
}
API.post('listing', {
data: data,
config: {
headers: {
'Content-Type': 'multipart/form-data',
'Access-Control-Allow-Origin': 'login.gmu.edu',
},
}
data: this.form,
}).catch(function (response) {
//handle error
console.log(response);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment