Use the filepond-image field, parse the API envelope, and load private files through the authenticated content endpoint so uploads persist and images display.
16 lines
520 B
JavaScript
16 lines
520 B
JavaScript
// /src/api/filesApi.js
|
|
import axiosInstance from './axiosInstance';
|
|
|
|
export const filesApi = {
|
|
uploadTemp: (formData) => axiosInstance.post('/files/admin/upload-temp', formData, {
|
|
timeout: 120000
|
|
}),
|
|
getSignedUrl: (filename, bucket = 'temp') =>
|
|
axiosInstance.get(`/files/admin/signed-url/${encodeURIComponent(filename)}`, { params: { bucket } }),
|
|
getContent: (key, bucket) => axiosInstance.get('/files/admin/content', {
|
|
params: { key, bucket },
|
|
responseType: 'blob',
|
|
timeout: 120000
|
|
})
|
|
};
|