mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
changes requested
This commit is contained in:
parent
ed8549bfb5
commit
d7919ea10f
@ -304,7 +304,7 @@ export class TransactionResolver {
|
|||||||
@Args() { identifier, amount, memo }: TransactionSendArgs,
|
@Args() { identifier, amount, memo }: TransactionSendArgs,
|
||||||
@Ctx() context: Context,
|
@Ctx() context: Context,
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
logger.info(`sendCoins(email=${email}, amount=${amount}, memo=${memo})`)
|
logger.info(`sendCoins(identifier=${identifier}, amount=${amount}, memo=${memo})`)
|
||||||
if (amount.lte(0)) {
|
if (amount.lte(0)) {
|
||||||
throw new LogError('Amount to send must be positive', amount)
|
throw new LogError('Amount to send must be positive', amount)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -823,10 +823,9 @@ export class UserResolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Authorized([RIGHTS.USER])
|
@Authorized([RIGHTS.USER])
|
||||||
@Query(() => User, { nullable: true })
|
@Query(() => User)
|
||||||
async user(@Arg('identifier') identifier: string): Promise<User | null> {
|
async user(@Arg('identifier') identifier: string): Promise<User> {
|
||||||
const user = await findUserByIdentifier(identifier)
|
return new User(await findUserByIdentifier(identifier))
|
||||||
return user ? new User(user) : null
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { UserContact as DbUserContact } from '@entity/UserContact'
|
|||||||
import LogError from '@/server/LogError'
|
import LogError from '@/server/LogError'
|
||||||
import { validate, version } from 'uuid'
|
import { validate, version } from 'uuid'
|
||||||
|
|
||||||
export const findUserByIdentifier = async (identifier: string): Promise<DbUser | null> => {
|
export const findUserByIdentifier = async (identifier: string): Promise<DbUser> => {
|
||||||
let user: DbUser | undefined
|
let user: DbUser | undefined
|
||||||
if (validate(identifier) && version(identifier) === 4) {
|
if (validate(identifier) && version(identifier) === 4) {
|
||||||
user = await DbUser.findOne({ where: { gradidoID: identifier }, relations: ['emailContact'] })
|
user = await DbUser.findOne({ where: { gradidoID: identifier }, relations: ['emailContact'] })
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user