Skip to content

Commit

Permalink
fix(backend): fix build & tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pYassine committed Sep 17, 2024
1 parent 123620b commit a90d1f3
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/backend/src/database/services/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// @index('./*', f => `export * from '${f.path}'`)
export * from "./_postgres";
export * from "./_scripts";
export * from "./app-log";
export * from "./contact";
export * from "./interaction";
export * from "./message-email";
export * from "./message-sms";
export * from "./monitoring";
export * from "./place";
export * from "./structure";
export * from "./structure-doc";
export * from "./usager";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { domifaConfig } from "../../../config";
import {
dataEmailAnonymizer,
MessageEmailId,
MessageEmailRecipient,
} from "../../../database";
import { MessageEmailId, MessageEmailRecipient } from "../../../database";
import { appLogger } from "../../../util";

export const mailRecipientsFilter = {
Expand Down Expand Up @@ -48,7 +44,7 @@ function filterRecipients(
toSkip = toSkip.concat(recipients);
} else {
recipients.forEach((recipient) => {
if (isRecipientToSkip(recipient)) {
if (isRecipientToSkip()) {
toSkip.push(recipient);
} else {
toSend.push(recipient);
Expand All @@ -72,10 +68,9 @@ function filterRecipients(
return { toSend, toSkip, toSkipString };
}

function isRecipientToSkip(recipient: MessageEmailRecipient) {
function isRecipientToSkip() {
return (
!domifaConfig().email.emailsEnabled ||
dataEmailAnonymizer.isAnonymizedEmail(recipient.address) ||
domifaConfig().email.emailAddressRedirectAllTo
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export const UsagersControllerSecurityTests: AppTestHttpClientSecurityTestDef[]
body: {
nom: "nom",
prenom: "prenom",
usagerRef: 4,
},
}
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,9 @@ export class UsagersController {
): Promise<Usager[]> {
return usagerRepository
.createQueryBuilder()
.select(["nom", "prenom", "ref", "dateNaissance"])
.select(
joinSelectFields(["nom", "prenom", "ref", "customRef", "dateNaissance"])
)
.where(
`"structureId" = :structureId and LOWER("nom") = :nom and LOWER("prenom") = :prenom`,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@ <h2 class="title">Modifier les informations de votre structure</h2>
/>
CCAS / Commune / Mairie
</label>
<label
for="asso"
class="btn py-3 px-4"
[ngClass]="{
'btn-primary': f.structureType.value === 'asso',
'btn-outline-primary': f.structureType.value !== 'asso',
'btn-outline-danger': submitted && f.structureType.value === null
}"
>
<input
formControlName="structureType"
name="structureType"
type="radio"
value="asso"
id="asso"
/>
Organisme agréé
</label>
</div>
<p
*ngIf="submitted && f.structureType.value === null"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class StepEtatCivilComponent
.subscribe((duplicates: UsagerLight[]) => {
this.duplicates = duplicates ?? [];
if (this.usager?.ref && this.duplicates.length) {
this.duplicates.filter(
this.duplicates = this.duplicates.filter(
(usager) => this.usager.ref !== usager.ref
);
}
Expand Down

0 comments on commit a90d1f3

Please sign in to comment.