fix: remove attachment by id #725
No reviewers
Labels
No Label
area/internal-code
changes requested
confirmed
dependencies
duplicate
good first issue
help wanted
hosting
invalid
kind/bug
kind/feature
question
wontfix
No Milestone
No project
No Assignees
2 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/frontend#725
Loading…
Reference in New Issue
No description provided.
Delete Branch "dpschen/frontend:feature/remove-attachment-by-id"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -1,5 +1,10 @@
import Vue from 'vue'
// FIXME: put in global helper
I'm using this function later as a helper in the store.
Since it is not merged yet I created a local copy as a helper.
Sounds fine, could you remove this PR as wip until the other one got merged?
I would rather merge it already since the other one is the vue3 main branch (again keeping changes small).
But I guess I could already add the real helper. Will put on WIP until I added that.
I moved it in a helper file.
@ -15,13 +20,9 @@ export default {
state.attachments.push(attachment)
},
removeById(state, id) {
for (const a in state.attachments) {
Some problem as we had already: looping via for...in doesn't result in consistant indices.
fix: remove attachment by idto wip: fix: remove attachment by id572993555f
tob201729cdd
@ -0,0 +1,3 @@
export function findIndexById(array : [], id : string | number) {
I'm not sure if an id can be of type number sometimes since it seemed to me that sometimes the
index === id
.Since this is a helper function I guess the type could also be
any
If this is fine as-is feel free to merge.
wip: fix: remove attachment by idto fix: remove attachment by id