Merge pull request #24013 from nextcloud/backport/23981/stable19
[stable19] Fix js search in undefined ocs response
This commit is contained in:
commit
4cd66463dc
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -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 {
|
||||||
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 {
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue