fix(notification+vlog upload)
This commit is contained in:
@@ -289,7 +289,7 @@ import { useRoute, useRouter } from 'vue-router'
|
||||
import { useAuthStore } from '@/stores/auth'
|
||||
import { useToast } from 'vue-toastification'
|
||||
import axios from '@/utils/axios'
|
||||
import { getMediaUrl } from '@/utils/axios'
|
||||
import { getMediaUrl, uploadFormData } from '@/utils/axios'
|
||||
import { formatRelativeDateInFrenchTimezone } from '@/utils/dateUtils'
|
||||
import {
|
||||
Plus,
|
||||
@@ -465,9 +465,8 @@ async function handleImageChange(event) {
|
||||
const formData = new FormData()
|
||||
formData.append('file', file)
|
||||
|
||||
const response = await axios.post('/api/posts/upload-image', formData)
|
||||
|
||||
newPost.value.image_url = response.data.image_url
|
||||
const data = await uploadFormData('/api/posts/upload-image', formData)
|
||||
newPost.value.image_url = data.image_url
|
||||
} catch (error) {
|
||||
toast.error('Erreur lors de l\'upload de l\'image')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user