Files
manja_dev_ui/src/services/fileService.js
T
Wian Drs 73a32380e7
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
base struktur update
2026-07-27 16:25:37 +07:00

24 lines
575 B
JavaScript

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
}