Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Page TypeORM - /tutorials/typeorm (Typo) #2328

Closed
kkeolmusae opened this issue Apr 27, 2023 · 3 comments · Fixed by #2358
Closed

[BUG] Page TypeORM - /tutorials/typeorm (Typo) #2328

kkeolmusae opened this issue Apr 27, 2023 · 3 comments · Fixed by #2358

Comments

@kkeolmusae
Copy link

Create an injectable repository

import {Injectable} from "@tsed/di";
import {DataSource} from "typeorm";
import {MySqlDataSource} from "../datasources/MySqlDataSource";
import {User} from "../entities/User";

export const UserRepository = MySqlDataSource.getRepository(User).extends({
  findByName(firstName: string, lastName: string) {
    return this.createQueryBuilder("user")
      .where("user.firstName = :firstName", {firstName})
      .andWhere("user.lastName = :lastName", {lastName})
      .getMany();
  }
});
export const USER_REPOSITORY = Symbol.for("UserRepository");
export type USER_REPOSITORY = typeof UserRepository;

registerProvider({
  provide: USER_REPOSITORY,
  useValue: UserRepository
});

export const UserRepository = MySqlDataSource.getRepository(User).extends({

Typo: extends -> extend

@kkeolmusae kkeolmusae changed the title [BUG] Page TypeORM - /tutorials/typeorm [BUG] Page TypeORM - /tutorials/typeorm (Typo) Apr 27, 2023
@github-actions
Copy link

🎉 Are you happy?

If you appreciated the support, know that it is free and is carried out on personal time ;)

A support, even a little bit makes a difference for me and continues to bring you answers!

github opencollective

@Romakita
Copy link
Collaborator

🎉 This issue has been resolved in version 7.31.0-rc.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Romakita
Copy link
Collaborator

🎉 This issue has been resolved in version 7.30.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants