Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async insert () {
- let formData = new FormData();
- formData.append('file', this.file);
- const response = await this.$axios.post('http://elgrove.co/api/v1/files',
- formData,
- {
- headers: {
- 'Content-Type': 'multipart/form-data',
- 'Authorization': `Bearer ${this.$store.state.auth.authUser.accessToken}`
- }
- }
- );
- const file_id = response.data.data.uploaded[0].id;
- console.log('FILE_ID', file_id);
- const response2 = await this.$axios.request({
- url: `http://elgrove.co/api/v1/bills`,
- method: 'post',
- headers: {
- 'Authorization': `Bearer ${this.$store.state.auth.authUser.accessToken}`
- },
- data: this.editedItem
- });
- const uid = response2.data.data.id;
- this.editedItem.id = uid;
- this.editedItem.file = file_id; // requiero del file_id
- this.regs.push(this.editedItem);
- this.pagination.totalItems++;
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement