2020-11-19 19:39:22 +01:00
|
|
|
import API from "./api"
|
2020-11-12 13:24:45 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Uploads an attachment to the server.
|
|
|
|
*/
|
2021-06-08 13:50:58 +02:00
|
|
|
export const uploadAttachment = async (data, tableId = "") => {
|
2020-11-19 19:39:22 +01:00
|
|
|
return await API.post({
|
2021-06-08 13:50:58 +02:00
|
|
|
url: `/api/attachments/${tableId}/upload`,
|
2020-11-12 13:24:45 +01:00
|
|
|
body: data,
|
|
|
|
json: false,
|
|
|
|
})
|
|
|
|
}
|