mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-11 03:24:16 +00:00
use remoteStorage
This commit is contained in:
parent
2920dabd4b
commit
2d3a0d659b
@ -1,7 +1,13 @@
|
|||||||
export default class FilesModel {
|
export default class FilesModel {
|
||||||
static async uploadFile(file) {
|
static async uploadFile(file, ...args) {
|
||||||
|
const result = await app.cores.remoteStorage.uploadFile(file, ...args)
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
static async deprecated_uploadFile(file) {
|
||||||
console.log("uploadFile", file)
|
console.log("uploadFile", file)
|
||||||
|
|
||||||
// get the file from the payload
|
// get the file from the payload
|
||||||
if (!file) {
|
if (!file) {
|
||||||
throw new Error("File is required")
|
throw new Error("File is required")
|
||||||
@ -14,7 +20,7 @@ export default class FilesModel {
|
|||||||
formData.append("files", file)
|
formData.append("files", file)
|
||||||
|
|
||||||
// send the request
|
// send the request
|
||||||
const uploadRequest = await app.cores.api.customRequest( {
|
const uploadRequest = await app.cores.api.customRequest({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "/files/upload",
|
url: "/files/upload",
|
||||||
data: formData,
|
data: formData,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user