Skip to content

How to hook to update instead of deleting and stop creating #2151

Answered by pwFoo
pwFoo asked this question in Q&A
Discussion options

You must be logged in to vote

Fixed my hook... works now

hookDeleting = (primKey, obj, transaction) => {
                logger("HookDeleting", primKey, obj, transaction)
                transaction.on('abort', () => {
                    primKey = primKey.split('+')
                    obj = { id: primKey[0], key: primKey[1], val: "MODIFIED_INSTEAD_DELETED!" }
                    window['$'].data.put(obj)
                    console.log("DEBUG", obj)
                })
                transaction.abort()
            }

Replies: 7 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@dfahlander
Comment options

@pwFoo
Comment options

Answer selected by pwFoo
Comment options

You must be logged in to vote
1 reply
@pwFoo
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants