Skip to content
Snippets Groups Projects
Unverified Commit 53e56b4d authored by John Molakvoæ's avatar John Molakvoæ
Browse files
parent 72545ffd
No related branches found
No related tags found
No related merge requests found
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -53,7 +53,7 @@ export default { ...@@ -53,7 +53,7 @@ export default {
async createShare({ path, permissions, shareType, shareWith, publicUpload, password, sendPasswordByTalk, expireDate, label }) { async createShare({ path, permissions, shareType, shareWith, publicUpload, password, sendPasswordByTalk, expireDate, label }) {
try { try {
const request = await axios.post(shareUrl, { path, permissions, shareType, shareWith, publicUpload, password, sendPasswordByTalk, expireDate, label }) const request = await axios.post(shareUrl, { path, permissions, shareType, shareWith, publicUpload, password, sendPasswordByTalk, expireDate, label })
if (!('ocs' in request.data)) { if (!request?.data?.ocs) {
throw request throw request
} }
return new Share(request.data.ocs.data) return new Share(request.data.ocs.data)
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
async deleteShare(id) { async deleteShare(id) {
try { try {
const request = await axios.delete(shareUrl + `/${id}`) const request = await axios.delete(shareUrl + `/${id}`)
if (!('ocs' in request.data)) { if (!request?.data?.ocs) {
throw request throw request
} }
return true return true
...@@ -93,7 +93,7 @@ export default { ...@@ -93,7 +93,7 @@ export default {
async updateShare(id, properties) { async updateShare(id, properties) {
try { try {
const request = await axios.put(shareUrl + `/${id}`, properties, headers) const request = await axios.put(shareUrl + `/${id}`, properties, headers)
if (!('ocs' in request.data)) { if (!request?.data?.ocs) {
throw request throw request
} }
return true return true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment