mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
send form with gradido id via url query
This commit is contained in:
parent
8db5c055e5
commit
7232780bae
@ -65,7 +65,7 @@
|
||||
<b-col>{{ $t('form.recipient') }}</b-col>
|
||||
</b-row>
|
||||
<b-row>
|
||||
<b-col>{{ gradidoID }}</b-col>
|
||||
<b-col class="font-weight-bold">{{ userName }}</b-col>
|
||||
</b-row>
|
||||
</div>
|
||||
</b-col>
|
||||
@ -129,6 +129,7 @@ import { SEND_TYPES } from '@/pages/Send'
|
||||
import InputEmail from '@/components/Inputs/InputEmail'
|
||||
import InputAmount from '@/components/Inputs/InputAmount'
|
||||
import InputTextarea from '@/components/Inputs/InputTextarea'
|
||||
import { user as userQuery } from '@/graphql/queries'
|
||||
|
||||
export default {
|
||||
name: 'TransactionForm',
|
||||
@ -153,6 +154,7 @@ export default {
|
||||
memo: this.memo,
|
||||
},
|
||||
radioSelected: this.selected,
|
||||
userName: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -173,11 +175,32 @@ export default {
|
||||
this.form.amount = ''
|
||||
this.form.memo = ''
|
||||
this.$refs.formValidator.validate()
|
||||
if (this.$route.query && !this.$route.query === {}) this.$router.replace({ query: undefined })
|
||||
},
|
||||
setNewRecipientEmail() {
|
||||
this.form.email = this.recipientEmail ? this.recipientEmail : this.form.email
|
||||
},
|
||||
},
|
||||
apollo: {
|
||||
UserName: {
|
||||
query() {
|
||||
return userQuery
|
||||
},
|
||||
fetchPolicy: 'network-only',
|
||||
variables() {
|
||||
return { identifier: this.gradidoID }
|
||||
},
|
||||
skip() {
|
||||
return !this.gradidoID
|
||||
},
|
||||
update({ user }) {
|
||||
this.userName = `${user.firstName} ${user.lastName}`
|
||||
},
|
||||
error({ message }) {
|
||||
this.toastError(message)
|
||||
},
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
recipientEmail() {
|
||||
this.setNewRecipientEmail()
|
||||
|
||||
@ -36,8 +36,8 @@ export default {
|
||||
methods: {
|
||||
tunnelEmail() {
|
||||
this.$emit('set-tunneled-email', this.linkedUser.email)
|
||||
if (this.$router.history.current.fullPath !== '/send')
|
||||
this.$router.push({ path: '/send', query: { gradidoID: this.linkedUser.gradidoID } })
|
||||
if (this.$router.history.current.fullPath !== '/send') this.$router.push({ path: '/send' })
|
||||
this.$router.push({ query: { gradidoID: this.linkedUser.gradidoID } })
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
|
||||
@ -268,3 +268,12 @@ export const openCreations = gql`
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const user = gql`
|
||||
query($identifier: String!) {
|
||||
user(identifier: $identifier) {
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user