mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
adapt communityUuid treatment
This commit is contained in:
parent
053b92ed59
commit
1940b7b604
@ -7,9 +7,9 @@ import { IsPositiveDecimal } from '@/graphql/validator/Decimal'
|
||||
|
||||
@ArgsType()
|
||||
export class TransactionSendArgs {
|
||||
@Field(() => String, { nullable: true })
|
||||
@Field(() => String)
|
||||
@IsString()
|
||||
recipientCommunityIdentifier?: string | null | undefined
|
||||
recipientCommunityIdentifier: string
|
||||
|
||||
@Field(() => String)
|
||||
@IsString()
|
||||
|
||||
@ -426,11 +426,16 @@ export class TransactionResolver {
|
||||
|
||||
if (!recipientCommunityIdentifier || (await isHomeCommunity(recipientCommunityIdentifier))) {
|
||||
// processing sendCoins within sender and recepient are both in home community
|
||||
// validate recipient user
|
||||
const recipientUser = await findUserByIdentifier(recipientIdentifier)
|
||||
const recipientUser = await findUserByIdentifier(
|
||||
recipientIdentifier,
|
||||
recipientCommunityIdentifier,
|
||||
)
|
||||
if (!recipientUser) {
|
||||
throw new LogError('The recipient user was not found', recipientUser)
|
||||
}
|
||||
if (recipientUser.foreign) {
|
||||
throw new LogError('Found foreign recipient user for a local transaction:', recipientUser)
|
||||
}
|
||||
|
||||
await executeTransaction(amount, memo, senderUser, recipientUser)
|
||||
logger.info('successful executeTransaction', amount, memo, senderUser, recipientUser)
|
||||
|
||||
@ -35,8 +35,9 @@ export const findUserByIdentifier = async (
|
||||
}
|
||||
if (userContact.user.communityUuid !== communityIdentifier) {
|
||||
throw new LogError(
|
||||
'Found user to given contact, but belongs to foreign community',
|
||||
'Found user to given contact, but belongs to other community',
|
||||
identifier,
|
||||
communityIdentifier,
|
||||
)
|
||||
}
|
||||
user = userContact.user
|
||||
|
||||
@ -235,6 +235,7 @@ export default {
|
||||
update({ user, community }) {
|
||||
this.userName = `${user.firstName} ${user.lastName}`
|
||||
this.recipientCommunity.name = community.name
|
||||
this.recipientCommunity.uuid = this.communityUuid
|
||||
},
|
||||
error({ message }) {
|
||||
this.toastError(message)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user