mirror of
https://github.com/IT4Change/gradido.git
synced 2026-03-29 05:35:41 +00:00
setTransactionLink with deepcopy to update recipientUser
This commit is contained in:
parent
c60f2429c2
commit
660ba90e5f
@ -274,12 +274,10 @@ onError(() => {
|
||||
|
||||
function setTransactionLinkInformation() {
|
||||
console.log('TransactionLink.setTransactionLinkInformation... result=', result.value)
|
||||
const queryTransactionLink = result.value.queryTransactionLink
|
||||
console.log(
|
||||
'TransactionLink.setTransactionLinkInformation... queryTransactionLink=',
|
||||
queryTransactionLink,
|
||||
)
|
||||
if (queryTransactionLink && queryTransactionLink.__typename === 'TransactionLink') {
|
||||
// const queryTransactionLink = result.value.queryTransactionLink
|
||||
const deepCopy = JSON.parse(JSON.stringify(result.value))
|
||||
console.log('TransactionLink.setTransactionLinkInformation... deepCopy=', deepCopy)
|
||||
if (deepCopy && deepCopy.queryTransactionLink.__typename === 'TransactionLink') {
|
||||
console.log('TransactionLink.setTransactionLinkInformation... typename === TransactionLink')
|
||||
// recipientUser is only set if the user is logged in
|
||||
if (store.state.gradidoID !== null) {
|
||||
@ -287,18 +285,18 @@ function setTransactionLinkInformation() {
|
||||
'TransactionLink.setTransactionLinkInformation... gradidoID=',
|
||||
store.state.gradidoID,
|
||||
)
|
||||
queryTransactionLink.recipientUser = {
|
||||
deepCopy.queryTransactionLink.recipientUser = {
|
||||
__typename: 'User',
|
||||
gradidoID: store.state.gradidoID,
|
||||
firstName: store.state.firstName,
|
||||
alias: store.state.alias,
|
||||
}
|
||||
console.log(
|
||||
'TransactionLink.setTransactionLinkInformation... queryTransactionLink.recipientUser=',
|
||||
queryTransactionLink.recipientUser,
|
||||
'TransactionLink.setTransactionLinkInformation... deepCopy.queryTransactionLink.recipientUser=',
|
||||
deepCopy.queryTransactionLink.recipientUser,
|
||||
)
|
||||
}
|
||||
linkData.value = queryTransactionLink
|
||||
linkData.value = deepCopy.queryTransactionLink
|
||||
console.log('TransactionLink.setTransactionLinkInformation... linkData.value=', linkData.value)
|
||||
if (linkData.value.__typename === 'ContributionLink' && store.state.token) {
|
||||
console.log('TransactionLink.setTransactionLinkInformation... typename === ContributionLink')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user