mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-15 17:14:05 -08:00
15 lines
425 B
TypeScript
15 lines
425 B
TypeScript
|
/* eslint-disable import/no-cycle */
|
||
|
import { EntityManager, In } from 'typeorm';
|
||
|
import { Db } from '..';
|
||
|
import { User } from '../databases/entities/User';
|
||
|
|
||
|
export class UserService {
|
||
|
static async get(user: Partial<User>): Promise<User | undefined> {
|
||
|
return Db.collections.User.findOne(user);
|
||
|
}
|
||
|
|
||
|
static async getByIds(transaction: EntityManager, ids: string[]) {
|
||
|
return transaction.find(User, { id: In(ids) });
|
||
|
}
|
||
|
}
|