base struktur update
NPM Installation / build (16.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (16.x, windows-latest) (push) Has been cancelled
NPM Installation / build (17.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (17.x, windows-latest) (push) Has been cancelled
NPM Installation / build (18.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (18.x, windows-latest) (push) Has been cancelled
NPM Installation / build (16.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (16.x, windows-latest) (push) Has been cancelled
NPM Installation / build (17.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (17.x, windows-latest) (push) Has been cancelled
NPM Installation / build (18.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (18.x, windows-latest) (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import api from '@/api/axios'
|
||||
|
||||
export async function uploadFile(file, category = 'general') {
|
||||
const payload = new FormData()
|
||||
payload.append('file', file)
|
||||
payload.append('category', category)
|
||||
|
||||
const { data } = await api.post('/files', payload, {
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
})
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
export async function getTemporaryFileUrl(uuid) {
|
||||
const { data } = await api.get(`/files/${uuid}/temporary-url`)
|
||||
return data
|
||||
}
|
||||
|
||||
export async function deleteFile(uuid) {
|
||||
const { data } = await api.delete(`/files/${uuid}`)
|
||||
return data
|
||||
}
|
||||
Reference in New Issue
Block a user