mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
linting
This commit is contained in:
parent
348783fdba
commit
d4daf65a4d
@ -46,7 +46,7 @@ const validCommunityIdentifier = ref(false)
|
||||
const { onResult } = useQuery(selectCommunities)
|
||||
|
||||
onResult(({ data }) => {
|
||||
console.log('CommunitySwitch.onResult...data=', data)
|
||||
// console.log('CommunitySwitch.onResult...data=', data)
|
||||
if (data) {
|
||||
communities.value = data.communities
|
||||
setDefaultCommunity()
|
||||
@ -56,29 +56,42 @@ onResult(({ data }) => {
|
||||
const communityIdentifier = computed(() => route.params.communityIdentifier)
|
||||
|
||||
function updateCommunity(community) {
|
||||
console.log('CommunitySwitch.updateCommunity...community=', community)
|
||||
// console.log('CommunitySwitch.updateCommunity...community=', community)
|
||||
emit('update:model-value', community)
|
||||
}
|
||||
|
||||
function setDefaultCommunity() {
|
||||
console.log('CommunitySwitch.setDefaultCommunity... communityIdentifier= communities=', communityIdentifier, communities)
|
||||
// console.log(
|
||||
// 'CommunitySwitch.setDefaultCommunity... communityIdentifier= communities=',
|
||||
// communityIdentifier,
|
||||
// communities,
|
||||
// )
|
||||
if (communityIdentifier.value && communities.value.length >= 1) {
|
||||
console.log('CommunitySwitch.setDefaultCommunity... communities.value.length=', communities.value.length)
|
||||
// console.log(
|
||||
// 'CommunitySwitch.setDefaultCommunity... communities.value.length=',
|
||||
// communities.value.length,
|
||||
// )
|
||||
const foundCommunity = communities.value.find((community) => {
|
||||
console.log('CommunitySwitch.setDefaultCommunity... community=', community)
|
||||
// console.log('CommunitySwitch.setDefaultCommunity... community=', community)
|
||||
if (
|
||||
community.uuid === communityIdentifier.value ||
|
||||
community.name === communityIdentifier.value
|
||||
) {
|
||||
validCommunityIdentifier.value = true
|
||||
console.log('CommunitySwitch.setDefaultCommunity...true validCommunityIdentifier=', validCommunityIdentifier)
|
||||
// console.log(
|
||||
// 'CommunitySwitch.setDefaultCommunity...true validCommunityIdentifier=',
|
||||
// validCommunityIdentifier,
|
||||
// )
|
||||
return true
|
||||
}
|
||||
console.log('CommunitySwitch.setDefaultCommunity...false validCommunityIdentifier=', validCommunityIdentifier)
|
||||
// console.log(
|
||||
// 'CommunitySwitch.setDefaultCommunity...false validCommunityIdentifier=',
|
||||
// validCommunityIdentifier,
|
||||
// )
|
||||
return false
|
||||
})
|
||||
if (foundCommunity) {
|
||||
console.log('CommunitySwitch.setDefaultCommunity...foundCommunity=', foundCommunity)
|
||||
// console.log('CommunitySwitch.setDefaultCommunity...foundCommunity=', foundCommunity)
|
||||
updateCommunity(foundCommunity)
|
||||
return
|
||||
}
|
||||
@ -87,13 +100,20 @@ function setDefaultCommunity() {
|
||||
|
||||
if (validCommunityIdentifier.value && !communityIdentifier.value) {
|
||||
validCommunityIdentifier.value = false
|
||||
console.log('CommunitySwitch.setDefaultCommunity...validCommunityIdentifier=', validCommunityIdentifier)
|
||||
// console.log(
|
||||
// 'CommunitySwitch.setDefaultCommunity...validCommunityIdentifier=',
|
||||
// validCommunityIdentifier,
|
||||
// )
|
||||
}
|
||||
|
||||
if (props.modelValue?.uuid === '' && communities.value.length) {
|
||||
console.log('CommunitySwitch.setDefaultCommunity...props.modelValue= communities=', props.modelValue, communities.value.length)
|
||||
// console.log(
|
||||
// 'CommunitySwitch.setDefaultCommunity...props.modelValue= communities=',
|
||||
// props.modelValue,
|
||||
// communities.value.length,
|
||||
// )
|
||||
const foundCommunity = communities.value.find((community) => !community.foreign)
|
||||
console.log('CommunitySwitch.setDefaultCommunity...foundCommunity=', foundCommunity)
|
||||
// console.log('CommunitySwitch.setDefaultCommunity...foundCommunity=', foundCommunity)
|
||||
if (foundCommunity) {
|
||||
updateCommunity(foundCommunity)
|
||||
}
|
||||
|
||||
@ -77,15 +77,15 @@ const currentRecipientCommunity = computed(
|
||||
const emit = defineEmits(['update:recipientCommunity'])
|
||||
|
||||
const isForeignCommunitySelected = computed(() => {
|
||||
console.log(
|
||||
'RedeemCommunitySelection.isForeignCommunitySelected...recipientCommunity=',
|
||||
currentRecipientCommunity.value,
|
||||
)
|
||||
// console.log(
|
||||
// 'RedeemCommunitySelection.isForeignCommunitySelected...recipientCommunity=',
|
||||
// currentRecipientCommunity.value,
|
||||
// )
|
||||
return currentRecipientCommunity.value.foreign
|
||||
})
|
||||
|
||||
function setRecipientCommunity(community) {
|
||||
console.log('RedeemCommunitySelection.setRecipientCommunity...community=', community)
|
||||
// console.log('RedeemCommunitySelection.setRecipientCommunity...community=', community)
|
||||
emit('update:recipientCommunity', {
|
||||
uuid: community.uuid,
|
||||
name: community.name,
|
||||
@ -95,10 +95,19 @@ function setRecipientCommunity(community) {
|
||||
}
|
||||
|
||||
function extractHomeCommunityFromLinkData(linkData) {
|
||||
console.log('RedeemCommunitySelection.extractHomeCommunityFromLinkData... props.linkData=', props.linkData)
|
||||
console.log('RedeemCommunitySelection.extractHomeCommunityFromLinkData...linkData=', linkData)
|
||||
console.log('RedeemCommunitySelection.extractHomeCommunityFromLinkData...communities=', linkData.communities)
|
||||
console.log('RedeemCommunitySelection.extractHomeCommunityFromLinkData...linkData.value=', linkData.value)
|
||||
// console.log(
|
||||
// 'RedeemCommunitySelection.extractHomeCommunityFromLinkData... props.linkData=',
|
||||
// props.linkData,
|
||||
// )
|
||||
// console.log('RedeemCommunitySelection.extractHomeCommunityFromLinkData...linkData=', linkData)
|
||||
// console.log(
|
||||
// 'RedeemCommunitySelection.extractHomeCommunityFromLinkData...communities=',
|
||||
// linkData.communities,
|
||||
// )
|
||||
// console.log(
|
||||
// 'RedeemCommunitySelection.extractHomeCommunityFromLinkData...linkData.value=',
|
||||
// linkData.value,
|
||||
// )
|
||||
|
||||
if (linkData.communities?.length === 0) {
|
||||
return {
|
||||
@ -109,15 +118,15 @@ function extractHomeCommunityFromLinkData(linkData) {
|
||||
}
|
||||
}
|
||||
const communities = linkData.communities
|
||||
console.log(
|
||||
'RedeemCommunitySelection.extractHomeCommunityFromLinkData...communities=',
|
||||
communities,
|
||||
)
|
||||
// console.log(
|
||||
// 'RedeemCommunitySelection.extractHomeCommunityFromLinkData...communities=',
|
||||
// communities,
|
||||
// )
|
||||
const homeCommunity = communities?.find((c) => c.foreign === false)
|
||||
console.log(
|
||||
'RedeemCommunitySelection.extractHomeCommunityFromLinkData...homeCommunity=',
|
||||
homeCommunity,
|
||||
)
|
||||
// console.log(
|
||||
// 'RedeemCommunitySelection.extractHomeCommunityFromLinkData...homeCommunity=',
|
||||
// homeCommunity,
|
||||
// )
|
||||
return {
|
||||
uuid: homeCommunity.uuid,
|
||||
name: homeCommunity.name,
|
||||
@ -130,20 +139,21 @@ const { mutate: createRedeemJwt } = useMutation(createRedeemJwtMutation)
|
||||
|
||||
async function onSwitch(event) {
|
||||
event.preventDefault() // Prevent the default navigation
|
||||
console.log('RedeemCommunitySelection.onSwitch... props=', props)
|
||||
// console.log('RedeemCommunitySelection.onSwitch... props=', props)
|
||||
if (isForeignCommunitySelected.value) {
|
||||
console.log('RedeemCommunitySelection.onSwitch vor createRedeemJwt params:', {
|
||||
gradidoId: props.linkData.senderUser?.gradidoID,
|
||||
senderCommunityUuid: senderCommunity.value.uuid,
|
||||
senderCommunityName: senderCommunity.value.name,
|
||||
recipientCommunityUuid: currentRecipientCommunity.value.uuid,
|
||||
code: props.redeemCode,
|
||||
amount: props.linkData.amount,
|
||||
memo: props.linkData.memo,
|
||||
firstName: props.linkData.senderUser?.firstName,
|
||||
alias: props.linkData.senderUser?.alias,
|
||||
validUntil: props.linkData.validUntil,
|
||||
})
|
||||
// console.log('RedeemCommunitySelection.onSwitch vor createRedeemJwt params:', {
|
||||
// gradidoId: props.linkData.senderUser?.gradidoID,
|
||||
// senderCommunityUuid: senderCommunity.value.uuid,
|
||||
// senderCommunityName: senderCommunity.value.name,
|
||||
// recipientCommunityUuid: currentRecipientCommunity.value.uuid,
|
||||
// code: props.redeemCode,
|
||||
// amount: props.linkData.amount,
|
||||
// memo: props.linkData.memo,
|
||||
// firstName: props.linkData.senderUser?.firstName,
|
||||
// alias: props.linkData.senderUser?.alias,
|
||||
// validUntil: props.linkData.validUntil,
|
||||
// })
|
||||
// eslint-disable-next-line no-useless-catch
|
||||
try {
|
||||
const { data } = await createRedeemJwt({
|
||||
gradidoId: props.linkData.senderUser?.gradidoID,
|
||||
@ -157,14 +167,14 @@ async function onSwitch(event) {
|
||||
alias: props.linkData.senderUser?.alias,
|
||||
validUntil: props.linkData.validUntil,
|
||||
})
|
||||
console.log('RedeemCommunitySelection.onSwitch... response=', data)
|
||||
// console.log('RedeemCommunitySelection.onSwitch... response=', data)
|
||||
if (!data?.createRedeemJwt) {
|
||||
throw new Error('Failed to get redeem token')
|
||||
}
|
||||
const targetUrl = currentRecipientCommunity.value.url.replace(/\/api\/?$/, '')
|
||||
window.location.href = targetUrl + '/redeem/' + data.createRedeemJwt
|
||||
} catch (error) {
|
||||
console.error('RedeemCommunitySelection.onSwitch error:', error)
|
||||
// console.error('RedeemCommunitySelection.onSwitch error:', error)
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
<!-- eslint-disable no-console -->
|
||||
<template>
|
||||
<div class="show-transaction-link-informations">
|
||||
<div v-if="isTransactionLinkLoaded" class="mt-4">
|
||||
@ -112,8 +111,8 @@ const tokenExpiresInSeconds = computed(() => {
|
||||
})
|
||||
|
||||
const validLink = computed(() => {
|
||||
console.log('TransactionLink.validLink... linkData.value.validUntil=', linkData.value.validUntil)
|
||||
console.log('TransactionLink.validLink... new Date()=', new Date())
|
||||
// console.log('TransactionLink.validLink... linkData.value.validUntil=', linkData.value.validUntil)
|
||||
// console.log('TransactionLink.validLink... new Date()=', new Date())
|
||||
if (!isTransactionLinkLoaded.value) {
|
||||
return false
|
||||
}
|
||||
@ -121,71 +120,71 @@ const validLink = computed(() => {
|
||||
return false
|
||||
}
|
||||
const validUntilDate = new Date(linkData.value.validUntil)
|
||||
console.log('TransactionLink.validLink... validUntilDate=', validUntilDate)
|
||||
console.log('TransactionLink.validLink... new Date()=', new Date())
|
||||
console.log(
|
||||
'TransactionLink.validLink... validUntilDate.getTime() >= new Date().getTime()=',
|
||||
validUntilDate.getTime() >= new Date().getTime(),
|
||||
)
|
||||
// console.log('TransactionLink.validLink... validUntilDate=', validUntilDate)
|
||||
// console.log('TransactionLink.validLink... new Date()=', new Date())
|
||||
// console.log(
|
||||
// 'TransactionLink.validLink... validUntilDate.getTime() >= new Date().getTime()=',
|
||||
// validUntilDate.getTime() >= new Date().getTime(),
|
||||
// )
|
||||
return validUntilDate.getTime() >= new Date().getTime()
|
||||
})
|
||||
|
||||
const itemType = computed(() => {
|
||||
console.log('TransactionLink.itemType... isTransactionLinkLoaded=', isTransactionLinkLoaded.value)
|
||||
// console.log('TransactionLink.itemType... isTransactionLinkLoaded=', isTransactionLinkLoaded.value)
|
||||
if (isTransactionLinkLoaded.value) {
|
||||
console.log('TransactionLink.itemType... linkData.value=', linkData.value)
|
||||
// console.log('TransactionLink.itemType... linkData.value=', linkData.value)
|
||||
if (linkData.value.deletedAt) {
|
||||
console.log('TransactionLink.itemType... TEXT_DELETED')
|
||||
// console.log('TransactionLink.itemType... TEXT_DELETED')
|
||||
return 'TEXT_DELETED'
|
||||
}
|
||||
|
||||
const validUntilDate = new Date(linkData.value.validUntil)
|
||||
console.log('TransactionLink.itemType... validUntilDate=', validUntilDate)
|
||||
console.log('TransactionLink.itemType... new Date()=', new Date())
|
||||
console.log(
|
||||
'TransactionLink.itemType... validUntilDate.getTime() < new Date().getTime()=',
|
||||
validUntilDate.getTime() < new Date().getTime(),
|
||||
)
|
||||
// console.log('TransactionLink.itemType... validUntilDate=', validUntilDate)
|
||||
// console.log('TransactionLink.itemType... new Date()=', new Date())
|
||||
// console.log(
|
||||
// 'TransactionLink.itemType... validUntilDate.getTime() < new Date().getTime()=',
|
||||
// validUntilDate.getTime() < new Date().getTime(),
|
||||
// )
|
||||
if (validUntilDate.getTime() < new Date().getTime()) {
|
||||
console.log('TransactionLink.itemType... TEXT_EXPIRED')
|
||||
// console.log('TransactionLink.itemType... TEXT_EXPIRED')
|
||||
return 'TEXT_EXPIRED'
|
||||
}
|
||||
if (linkData.value.redeemedAt) {
|
||||
console.log('TransactionLink.itemType... TEXT_REDEEMED')
|
||||
// console.log('TransactionLink.itemType... TEXT_REDEEMED')
|
||||
return 'TEXT_REDEEMED'
|
||||
}
|
||||
if (linkData.value.deletedAt) {
|
||||
console.log('TransactionLink.itemType... TEXT_DELETED')
|
||||
// console.log('TransactionLink.itemType... TEXT_DELETED')
|
||||
return 'TEXT_DELETED'
|
||||
}
|
||||
if (store.state.token && store.state.tokenTime) {
|
||||
if (tokenExpiresInSeconds.value < 5) {
|
||||
console.log('TransactionLink.itemType... REDEEM_SELECT_COMMUNITY')
|
||||
// console.log('TransactionLink.itemType... REDEEM_SELECT_COMMUNITY')
|
||||
return 'REDEEM_SELECT_COMMUNITY'
|
||||
}
|
||||
}
|
||||
console.log(
|
||||
'TransactionLink.itemType... linkData.value.recipientUser=',
|
||||
linkData.value.recipientUser,
|
||||
)
|
||||
console.log('TransactionLink.itemType... linkData.value=', linkData.value)
|
||||
console.log('TransactionLink.itemType... store.state.gradidoID=', store.state.gradidoID)
|
||||
console.log('TransactionLink.itemType... isRedeemJwtLink=', isRedeemJwtLink.value)
|
||||
console.log('TransactionLink.itemType... linkData.value.senderUser=', linkData.value.senderUser)
|
||||
console.log(
|
||||
'TransactionLink.itemType... linkData.value.recipientUser.gradidoID=',
|
||||
linkData.value.recipientUser?.gradidoID,
|
||||
)
|
||||
console.log(
|
||||
'TransactionLink.itemType... linkData.value.senderUser.gradidoID=',
|
||||
linkData.value.senderUser?.gradidoID,
|
||||
)
|
||||
// console.log(
|
||||
// 'TransactionLink.itemType... linkData.value.recipientUser=',
|
||||
// linkData.value.recipientUser,
|
||||
// )
|
||||
// console.log('TransactionLink.itemType... linkData.value=', linkData.value)
|
||||
// console.log('TransactionLink.itemType... store.state.gradidoID=', store.state.gradidoID)
|
||||
// console.log('TransactionLink.itemType... isRedeemJwtLink=', isRedeemJwtLink.value)
|
||||
// console.log('TransactionLink.itemType... linkData.value.senderUser=', linkData.value.senderUser)
|
||||
// console.log(
|
||||
// 'TransactionLink.itemType... linkData.value.recipientUser.gradidoID=',
|
||||
// linkData.value.recipientUser?.gradidoID,
|
||||
// )
|
||||
// console.log(
|
||||
// 'TransactionLink.itemType... linkData.value.senderUser.gradidoID=',
|
||||
// linkData.value.senderUser?.gradidoID,
|
||||
// )
|
||||
if (
|
||||
linkData.value.senderUser &&
|
||||
linkData.value.recipientUser &&
|
||||
linkData.value.senderUser.gradidoID === linkData.value.recipientUser.gradidoID
|
||||
) {
|
||||
console.log('TransactionLink.itemType... SELF_CREATOR')
|
||||
// console.log('TransactionLink.itemType... SELF_CREATOR')
|
||||
return 'SELF_CREATOR'
|
||||
}
|
||||
if (
|
||||
@ -194,27 +193,27 @@ const itemType = computed(() => {
|
||||
linkData.value.senderUser.gradidoID !== linkData.value.recipientUser.gradidoID &&
|
||||
store.state.gradidoID === linkData.value.recipientUser.gradidoID
|
||||
) {
|
||||
console.log('TransactionLink.itemType... VALID')
|
||||
console.log('TransactionLink.itemType... linkData.value=', linkData.value)
|
||||
console.log('TransactionLink.itemType... store.state.gradidoID=', store.state.gradidoID)
|
||||
console.log(
|
||||
'TransactionLink.itemType... linkData.value.recipientUser.gradidoID=',
|
||||
linkData.value.recipientUser.gradidoID,
|
||||
)
|
||||
console.log(
|
||||
'TransactionLink.itemType... linkData.value.senderUser.gradidoID=',
|
||||
linkData.value.senderUser.gradidoID,
|
||||
)
|
||||
// console.log('TransactionLink.itemType... VALID')
|
||||
// console.log('TransactionLink.itemType... linkData.value=', linkData.value)
|
||||
// console.log('TransactionLink.itemType... store.state.gradidoID=', store.state.gradidoID)
|
||||
// console.log(
|
||||
// 'TransactionLink.itemType... linkData.value.recipientUser.gradidoID=',
|
||||
// linkData.value.recipientUser.gradidoID,
|
||||
// )
|
||||
// console.log(
|
||||
// 'TransactionLink.itemType... linkData.value.senderUser.gradidoID=',
|
||||
// linkData.value.senderUser.gradidoID,
|
||||
// )
|
||||
return 'VALID'
|
||||
}
|
||||
}
|
||||
console.log('TransactionLink.itemType...last return= REDEEM_SELECT_COMMUNITY')
|
||||
// console.log('TransactionLink.itemType...last return= REDEEM_SELECT_COMMUNITY')
|
||||
return 'REDEEM_SELECT_COMMUNITY'
|
||||
})
|
||||
|
||||
const itemTypeExt = computed(() => {
|
||||
console.log('TransactionLink.itemTypeExt... itemType=', itemType.value)
|
||||
console.log('TransactionLink.itemTypeExt... validLink=', validLink.value)
|
||||
// console.log('TransactionLink.itemTypeExt... itemType=', itemType.value)
|
||||
// console.log('TransactionLink.itemTypeExt... validLink=', validLink.value)
|
||||
if (itemType.value.startsWith('TEXT')) {
|
||||
return 'TEXT'
|
||||
}
|
||||
@ -222,13 +221,13 @@ const itemTypeExt = computed(() => {
|
||||
})
|
||||
|
||||
watch(itemType, (newItemType) => {
|
||||
console.log('TransactionLink.watch... itemType=', itemType.value)
|
||||
console.log('TransactionLink.watch... validLink=', validLink.value)
|
||||
// console.log('TransactionLink.watch... itemType=', itemType.value)
|
||||
// console.log('TransactionLink.watch... validLink=', validLink.value)
|
||||
updateRedeemedBoxText(newItemType)
|
||||
})
|
||||
|
||||
function updateRedeemedBoxText(type) {
|
||||
console.log('TransactionLink.updateRedeemedBoxText... type=', type)
|
||||
// console.log('TransactionLink.updateRedeemedBoxText... type=', type)
|
||||
switch (type) {
|
||||
case 'TEXT_DELETED':
|
||||
redeemedBoxText.value = t('gdd_per_link.link-deleted', {
|
||||
@ -248,65 +247,65 @@ function updateRedeemedBoxText(type) {
|
||||
default:
|
||||
redeemedBoxText.value = ''
|
||||
}
|
||||
console.log('TransactionLink.updateRedeemedBoxText... redeemedBoxText=', redeemedBoxText)
|
||||
// console.log('TransactionLink.updateRedeemedBoxText... redeemedBoxText=', redeemedBoxText)
|
||||
}
|
||||
|
||||
const emit = defineEmits(['set-mobile-start'])
|
||||
|
||||
onMounted(() => {
|
||||
console.log('TransactionLink.onMounted... params=', params)
|
||||
// console.log('TransactionLink.onMounted... params=', params)
|
||||
emit('set-mobile-start', false)
|
||||
})
|
||||
|
||||
onResult(() => {
|
||||
console.log('TransactionLink.onResult... result=', result.value)
|
||||
console.log('TransactionLink.onResult... stringify result=', JSON.stringify(result.value))
|
||||
// console.log('TransactionLink.onResult... result=', result.value)
|
||||
// console.log('TransactionLink.onResult... stringify result=', JSON.stringify(result.value))
|
||||
if (result.value?.queryTransactionLink?.__typename === 'TransactionLink') {
|
||||
console.log('TransactionLink.onResult... TransactionLink')
|
||||
// console.log('TransactionLink.onResult... TransactionLink')
|
||||
isTransactionLinkLoaded.value = true
|
||||
setTransactionLinkInformation()
|
||||
} else if (result.value?.queryTransactionLink?.__typename === 'RedeemJwtLink') {
|
||||
console.log('TransactionLink.onResult... RedeemJwtLink')
|
||||
// console.log('TransactionLink.onResult... RedeemJwtLink')
|
||||
isTransactionLinkLoaded.value = true
|
||||
setRedeemJwtLinkInformation()
|
||||
} else {
|
||||
console.log('TransactionLink.onResult... unknown type:', result.value)
|
||||
// console.log('TransactionLink.onResult... unknown type:', result.value)
|
||||
}
|
||||
})
|
||||
|
||||
onError(() => {
|
||||
console.log('TransactionLink.onError... error=', error)
|
||||
// console.log('TransactionLink.onError... error=', error)
|
||||
toastError(t('gdd_per_link.redeemlink-error'))
|
||||
})
|
||||
|
||||
function setTransactionLinkInformation() {
|
||||
console.log('TransactionLink.setTransactionLinkInformation... result=', result.value)
|
||||
// console.log('TransactionLink.setTransactionLinkInformation... result=', result.value)
|
||||
// const queryTransactionLink = result.value.queryTransactionLink
|
||||
const deepCopy = JSON.parse(JSON.stringify(result.value))
|
||||
console.log('TransactionLink.setTransactionLinkInformation... deepCopy=', deepCopy)
|
||||
// console.log('TransactionLink.setTransactionLinkInformation... deepCopy=', deepCopy)
|
||||
if (deepCopy && deepCopy.queryTransactionLink.__typename === 'TransactionLink') {
|
||||
console.log('TransactionLink.setTransactionLinkInformation... typename === TransactionLink')
|
||||
// console.log('TransactionLink.setTransactionLinkInformation... typename === TransactionLink')
|
||||
// recipientUser is only set if the user is logged in
|
||||
if (store.state.gradidoID !== null) {
|
||||
console.log(
|
||||
'TransactionLink.setTransactionLinkInformation... gradidoID=',
|
||||
store.state.gradidoID,
|
||||
)
|
||||
// console.log(
|
||||
// 'TransactionLink.setTransactionLinkInformation... gradidoID=',
|
||||
// store.state.gradidoID,
|
||||
// )
|
||||
deepCopy.queryTransactionLink.recipientUser = {
|
||||
__typename: 'User',
|
||||
gradidoID: store.state.gradidoID,
|
||||
firstName: store.state.firstName,
|
||||
alias: store.state.alias,
|
||||
}
|
||||
console.log(
|
||||
'TransactionLink.setTransactionLinkInformation... deepCopy.queryTransactionLink.recipientUser=',
|
||||
deepCopy.queryTransactionLink.recipientUser,
|
||||
)
|
||||
// console.log(
|
||||
// 'TransactionLink.setTransactionLinkInformation... deepCopy.queryTransactionLink.recipientUser=',
|
||||
// deepCopy.queryTransactionLink.recipientUser,
|
||||
// )
|
||||
}
|
||||
linkData.value = deepCopy.queryTransactionLink
|
||||
console.log('TransactionLink.setTransactionLinkInformation... linkData.value=', linkData.value)
|
||||
// console.log('TransactionLink.setTransactionLinkInformation... linkData.value=', linkData.value)
|
||||
if (linkData.value.__typename === 'ContributionLink' && store.state.token) {
|
||||
console.log('TransactionLink.setTransactionLinkInformation... typename === ContributionLink')
|
||||
// console.log('TransactionLink.setTransactionLinkInformation... typename === ContributionLink')
|
||||
// explicit no await
|
||||
mutationLink(linkData.value.amount)
|
||||
}
|
||||
@ -314,16 +313,16 @@ function setTransactionLinkInformation() {
|
||||
}
|
||||
|
||||
function setRedeemJwtLinkInformation() {
|
||||
console.log('TransactionLink.setRedeemJwtLinkInformation... result=', result.value)
|
||||
// console.log('TransactionLink.setRedeemJwtLinkInformation... result=', result.value)
|
||||
const deepCopy = JSON.parse(JSON.stringify(result.value))
|
||||
console.log('TransactionLink.setRedeemJwtLinkInformation... deepCopy=', deepCopy)
|
||||
// console.log('TransactionLink.setRedeemJwtLinkInformation... deepCopy=', deepCopy)
|
||||
if (deepCopy) {
|
||||
// recipientUser is only set if the user is logged in
|
||||
if (store.state.gradidoID !== null) {
|
||||
console.log(
|
||||
'TransactionLink.setRedeemJwtLinkInformation... gradidoID=',
|
||||
store.state.gradidoID,
|
||||
)
|
||||
// console.log(
|
||||
// 'TransactionLink.setRedeemJwtLinkInformation... gradidoID=',
|
||||
// store.state.gradidoID,
|
||||
// )
|
||||
deepCopy.queryTransactionLink.recipientUser = {
|
||||
__typename: 'User',
|
||||
gradidoID: store.state.gradidoID,
|
||||
@ -331,19 +330,19 @@ function setRedeemJwtLinkInformation() {
|
||||
alias: store.state.alias,
|
||||
}
|
||||
}
|
||||
console.log(
|
||||
'TransactionLink.setRedeemJwtLinkInformation... deepCopy.queryTransactionLink.recipientUser=',
|
||||
deepCopy.queryTransactionLink.recipientUser,
|
||||
)
|
||||
// console.log(
|
||||
// 'TransactionLink.setRedeemJwtLinkInformation... deepCopy.queryTransactionLink.recipientUser=',
|
||||
// deepCopy.queryTransactionLink.recipientUser,
|
||||
// )
|
||||
linkData.value = deepCopy.queryTransactionLink
|
||||
console.log('TransactionLink.setRedeemJwtLinkInformation... linkData.value=', linkData.value)
|
||||
// console.log('TransactionLink.setRedeemJwtLinkInformation... linkData.value=', linkData.value)
|
||||
}
|
||||
}
|
||||
|
||||
async function mutationLink(amount) {
|
||||
console.log('TransactionLink.mutationLink... params=', params)
|
||||
// console.log('TransactionLink.mutationLink... params=', params)
|
||||
if (isRedeemJwtLink.value) {
|
||||
console.log('TransactionLink.mutationLink... trigger disbursement from recipient-community')
|
||||
// console.log('TransactionLink.mutationLink... trigger disbursement from recipient-community')
|
||||
try {
|
||||
await disburseMutate({
|
||||
code: params.code,
|
||||
@ -355,7 +354,7 @@ async function mutationLink(amount) {
|
||||
await router.push('/overview')
|
||||
}
|
||||
} else {
|
||||
console.log('TransactionLink.mutationLink... local transaction or contribution')
|
||||
// console.log('TransactionLink.mutationLink... local transaction or contribution')
|
||||
try {
|
||||
await redeemMutate({
|
||||
code: redeemCode.value,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user