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

[Question] repository #64

Closed
Paul75 opened this issue Aug 19, 2020 · 3 comments
Closed

[Question] repository #64

Paul75 opened this issue Aug 19, 2020 · 3 comments

Comments

@Paul75
Copy link

Paul75 commented Aug 19, 2020

Hello,

In your structure that can create specific repository in directory repository(for exemple) adn for exemple do a finction like :

@EntityRepository(Evaluation)
export class EvaluationRepository extends Repository<Evaluation> {
    public getListDatesEvaluation(
        beneficiaireId: number
    ): Promise<Evaluation[] | undefined> {
        return this.createQueryBuilder('evaluation')
            .select()
            .leftJoinAndSelect('evaluation.usagers', 'usagers')
            .where('usagers.id IN (:beneficiaireId)', {
                beneficiaireId,
            })
            .orderBy('evaluation.dateEvaluation', 'DESC')
            .getMany();
    }
}

Thanks

@javieraviles
Copy link
Owner

Hi!

Do you mean whether it would be possible to do this from the repository? which file exactly do you mean?

@Paul75
Copy link
Author

Paul75 commented Aug 20, 2020

Hello,

I mean to create a file name EvaluationRepository and in this add fonctions and call the repository in controller or another service ...

Thanks

@javieraviles
Copy link
Owner

yes sure why not, sounds good

@Paul75 Paul75 closed this as completed Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants