override attachment

Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
This commit is contained in:
Jakob Röhrl
2020-03-04 12:59:45 +01:00
committed by Julius Härtl
parent 725f99d8b8
commit d27a5ac9ba
9 changed files with 228 additions and 39 deletions

View File

@@ -38,7 +38,7 @@ export class AttachmentApi {
}
async createAttachment({ cardId, formData }) {
const response = await axios({
const response = await axios({
method: 'POST',
url: this.url(`/cards/${cardId}/attachment`),
data: formData,
@@ -48,10 +48,11 @@ export class AttachmentApi {
async updateAttachment({ cardId, attachmentId, formData }) {
const response = await axios({
method: 'PUT',
method: 'POST',
url: this.url(`/cards/${cardId}/attachment/${attachmentId}`),
data: formData,
})
console.log(response)
return response.data
}
@@ -61,6 +62,14 @@ export class AttachmentApi {
url: this.url(`/cards/${attachment.cardId}/attachment/${attachment.id}`),
})
}
async restoreAttachment(attachment) {
const response = await axios({
method: 'GET',
url: this.url(`/cards/${attachment.cardId}/attachment/${attachment.id}/restore`),
})
return response.data
}
async displayAttachment(attachment) {
const response = await axios({