Skip to content

Commit

Permalink
chore: start to implement delete
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos committed Oct 21, 2024
1 parent 59d40a3 commit a954644
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/store/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import { defineStore } from 'pinia'
import { set } from 'vue'
import { del, set } from 'vue'

import { getCurrentUser } from '@nextcloud/auth'
import axios from '@nextcloud/axios'
Expand Down Expand Up @@ -211,6 +211,13 @@ export const useFilesStore = function(...args) {
this.files[this.selectedNodeId].signers.filter((i) => i.identify !== signer.identify),
)
},
async delete(file) {
file = this.getFile(file)
const response = await axios.delete(generateOcsUrl('/apps/libresign/api/v1/sign/file_id/{fileId}', {

Check failure on line 216 in src/store/files.js

View workflow job for this annotation

GitHub Actions / NPM lint

'response' is assigned a value but never used
fileId: file.nodeId

Check warning on line 217 in src/store/files.js

View workflow job for this annotation

GitHub Actions / NPM lint

Missing trailing comma
}))
del(this.files, file.nodeId)
},
async getAllFiles(filter) {
if (!filter) filter = {}
const { chips } = useFiltersStore()
Expand Down
2 changes: 2 additions & 0 deletions src/views/FilesList/FileEntry/FileEntryActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ export default {
this.filesStore.selectFile(this.source.nodeId)
} else if (action.id === 'validate') {
this.$router.push({ name: 'ValidationFile', params: { uuid } })
} else if (action.id === 'delete') {
this.filesStore.delete(this.source)
}
},
registerAction(action) {
Expand Down

0 comments on commit a954644

Please sign in to comment.