Handle unshare in frontend

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2021-01-04 15:29:53 +01:00
parent 199cccf86b
commit 019444f9fc
4 changed files with 34 additions and 15 deletions

View File

@@ -47,10 +47,10 @@ export class AttachmentApi {
return response.data
}
async updateAttachment({ cardId, attachmentId, formData }) {
async updateAttachment({ cardId, attachment, formData }) {
const response = await axios({
method: 'POST',
url: this.url(`/cards/${cardId}/attachment/${attachmentId}`),
url: this.url(`/cards/${cardId}/attachment/${attachment.type}:${attachment.id}`),
data: formData,
})
return response.data
@@ -59,14 +59,14 @@ export class AttachmentApi {
async deleteAttachment(attachment) {
await axios({
method: 'DELETE',
url: this.url(`/cards/${attachment.cardId}/attachment/${attachment.id}`),
url: this.url(`/cards/${attachment.cardId}/attachment/${attachment.type}:${attachment.id}`),
})
}
async restoreAttachment(attachment) {
const response = await axios({
method: 'GET',
url: this.url(`/cards/${attachment.cardId}/attachment/${attachment.id}/restore`),
url: this.url(`/cards/${attachment.cardId}/attachment/${attachment.type}:${attachment.id}/restore`),
})
return response.data
}
@@ -74,7 +74,7 @@ export class AttachmentApi {
async displayAttachment(attachment) {
const response = await axios({
method: 'GET',
url: this.url(`/cards/${attachment.cardId}/attachment/${attachment.id}`),
url: this.url(`/cards/${attachment.cardId}/attachment/${attachment.type}:${attachment.id}`),
})
return response.data
}