-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: add endpoint to get revisions by client #154
base: master
Are you sure you want to change the base?
Conversation
const query = this.revisionRepository | ||
.createQueryBuilder('revisions') | ||
.select('revisions.id', 'id') | ||
.addSelect('revisions.code_commune', 'codeCommune') | ||
.addSelect('revisions.published_at', 'publishedAt') | ||
.addSelect('revisions.validation', 'validation') | ||
.addSelect('revisions.status', 'status') | ||
.addSelect('revisions.is_current', 'isCurrent') | ||
.distinctOn(['code_commune']) | ||
.orderBy('code_commune, published_at') | ||
.where('revisions.client_id = :clientId', { | ||
clientId: client.id, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il y a un problème, on ne doit pas renvoyer la première révisions des commune pour un client mais la dernière révision
const revisionsByClient = await this.revisionService.findFirstsByClient( | ||
req.client, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
La route ne doit pas renvoyer les première revisions par commune pour un client mais les dernière révisions des communes d'un client je pense
Related PR : BaseAdresseNationale/adresse.data.gouv.fr#2039