Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jtushman
Created May 31, 2019 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtushman/3a295f6407abf88293ba927b915867b0 to your computer and use it in GitHub Desktop.
Save jtushman/3a295f6407abf88293ba927b915867b0 to your computer and use it in GitHub Desktop.
@EntityRepository(Member)
export class MemberRepository extends Repository<Member> {
public async findOrCreate(user: User, account: Account) {
// ?? How do I get access to the connection ??
const notebookRepo = connection.getRepository(Notebook);
// do stuff with notebookRepo
// then
const member = new Member();
member.name = 'asdfadsf'
this.save(member)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment