mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-13 10:03:09 +02:00
17 lines
376 B
TypeScript
17 lines
376 B
TypeScript
|
import { EntityRepository, Repository } from 'typeorm';
|
||
|
import { UserList } from '../entities/user-list';
|
||
|
|
||
|
@EntityRepository(UserList)
|
||
|
export class UserListRepository extends Repository<UserList> {
|
||
|
public async pack(
|
||
|
src: any,
|
||
|
) {
|
||
|
const userList = typeof src === 'object' ? src : await this.findOne(src);
|
||
|
|
||
|
return {
|
||
|
id: userList.id,
|
||
|
name: userList.name
|
||
|
};
|
||
|
}
|
||
|
}
|