Add application to Resource.

This commit is contained in:
Yang Luo
2021-09-04 16:50:26 +08:00
parent 5d98cc6ac5
commit 015961bc3c
4 changed files with 27 additions and 9 deletions

View File

@ -56,9 +56,10 @@ export function deleteResource(resource, provider="") {
}
export function uploadResource(owner, tag, parent, fullFilePath, file, provider="") {
const application = "app-built-in";
let formData = new FormData();
formData.append("file", file);
return fetch(`${Setting.ServerUrl}/api/upload-resource?owner=${owner}&tag=${tag}&parent=${parent}&fullFilePath=${encodeURIComponent(fullFilePath)}&provider=${provider}`, {
return fetch(`${Setting.ServerUrl}/api/upload-resource?owner=${owner}&application=${application}&tag=${tag}&parent=${parent}&fullFilePath=${encodeURIComponent(fullFilePath)}&provider=${provider}`, {
body: formData,
method: 'POST',
credentials: 'include',