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,
|
||||
@Ctx() context: Context,
|
||||
): Promise<boolean> {
|
||||
logger.info(`sendCoins(email=${email}, amount=${amount}, memo=${memo})`)
|
||||
logger.info(`sendCoins(identifier=${identifier}, amount=${amount}, memo=${memo})`)
|
||||
if (amount.lte(0)) {
|
||||
throw new LogError('Amount to send must be positive', amount)
|
||||
}
|
||||
|
||||
@ -823,10 +823,9 @@ export class UserResolver {
|
||||
}
|
||||
|
||||
@Authorized([RIGHTS.USER])
|
||||
@Query(() => User, { nullable: true })
|
||||
async user(@Arg('identifier') identifier: string): Promise<User | null> {
|
||||
const user = await findUserByIdentifier(identifier)
|
||||
return user ? new User(user) : null
|
||||
@Query(() => User)
|
||||
async user(@Arg('identifier') identifier: string): Promise<User> {
|
||||
return new User(await findUserByIdentifier(identifier))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ import { UserContact as DbUserContact } from '@entity/UserContact'
|
||||
import LogError from '@/server/LogError'
|
||||
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
|
||||
if (validate(identifier) && version(identifier) === 4) {
|
||||
user = await DbUser.findOne({ where: { gradidoID: identifier }, relations: ['emailContact'] })
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user