A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/robsontenorio/vue-api-query/issues/83 below:

Upload a PDF file · Issue #83 · robsontenorio/vue-api-query · GitHub

Hello there,

I am trying to use this awesome plugin to upload a PDF file. I have created a model for this:

import Model from './Model';

export default class JobApplication extends Model {
  resource() {
    return 'v2/job_applications';
  }
}

Then, I call the model within the .vue file like that:

...
 import JobApplication from "./../models/JobApplication";
...
async onSubmit() {
  let job = new JobApplication({
    first_name,
    last_name,
    email,
    mobile_phone,
    resume: this.$refs.resume.files[0]
  });
  await job
    .save()
    .then(response => {
      console.log(response);
    })
    .catch(error => {
      console.error(error.response);
    });
}
...

The problem is that the POST request fails every time I try to submit the form because of the resume field. What am I doing wrong in here? Do I have to do any extra steps? Thank you


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4