Skip to content

Commit

Permalink
fix: drink water lint (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudambro authored Apr 5, 2024
1 parent a4678ce commit d890fce
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
5 changes: 2 additions & 3 deletions api-node/src/controllers/indicators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ router.get(
(list) => list.slug !== IndicatorsSlugEnum.drinking_water,
),
});
return;
} else {
res.status(200).send({ ok: true, data: indicatorsList });
}
res.status(200).send({ ok: true, data: indicatorsList });
return;
}),
);

Expand Down
3 changes: 1 addition & 2 deletions api-node/src/controllers/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import { z } from 'zod';
import { catchErrors } from '../middlewares/errors';
import prisma from '../prisma.js';
import { type CustomError } from '~/types/error';
import { type User } from '@prisma/client';
import { type User, type udis as UdiType } from '@prisma/client';
import { withUser } from '~/middlewares/auth.js';
import type { RequestWithUser } from '~/types/request';
import { type udis as UdiType } from '@prisma/client';
const router = express.Router();

router.post(
Expand Down
33 changes: 22 additions & 11 deletions api-node/src/utils/drinking_water.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,21 @@ function checkPrelevementConformity(
prelevement?: PrelevementConformity,
): ConformityEnum {
if (!prelevement) return ConformityEnum.NOT_TESTED;
if (!prelevement.conclusion_conformite_prelevement)
if (!prelevement.conclusion_conformite_prelevement) {
return ConformityEnum.NOT_TESTED;
if (!prelevement.conformite_limites_pc_prelevement)
}
if (!prelevement.conformite_limites_pc_prelevement) {
return ConformityEnum.NOT_TESTED;
if (!prelevement.conformite_references_pc_prelevement)
}
if (!prelevement.conformite_references_pc_prelevement) {
return ConformityEnum.NOT_TESTED;
if (!prelevement.conformite_limites_bact_prelevement)
}
if (!prelevement.conformite_limites_bact_prelevement) {
return ConformityEnum.NOT_TESTED;
if (!prelevement.conformite_references_bact_prelevement)
}
if (!prelevement.conformite_references_bact_prelevement) {
return ConformityEnum.NOT_TESTED;
}

const conformityLimitChemical = prelevement.conformite_limites_pc_prelevement;
const conformityReferenceChemical =
Expand Down Expand Up @@ -62,12 +67,15 @@ function checkPrelevementConformityChemical(
prelevement?: PrelevementConformity,
): ConformityEnum {
if (!prelevement) return ConformityEnum.NOT_TESTED;
if (!prelevement.conclusion_conformite_prelevement)
if (!prelevement.conclusion_conformite_prelevement) {
return ConformityEnum.NOT_TESTED;
if (!prelevement.conformite_limites_pc_prelevement)
}
if (!prelevement.conformite_limites_pc_prelevement) {
return ConformityEnum.NOT_TESTED;
if (!prelevement.conformite_references_pc_prelevement)
}
if (!prelevement.conformite_references_pc_prelevement) {
return ConformityEnum.NOT_TESTED;
}

const conformityLimitChemical = prelevement.conformite_limites_pc_prelevement;
const conformityReferenceChemical =
Expand All @@ -92,12 +100,15 @@ function checkPrelevementConformityBacteriological(
prelevement?: PrelevementConformity,
): ConformityEnum {
if (!prelevement) return ConformityEnum.NOT_TESTED;
if (!prelevement.conclusion_conformite_prelevement)
if (!prelevement.conclusion_conformite_prelevement) {
return ConformityEnum.NOT_TESTED;
if (!prelevement.conformite_limites_bact_prelevement)
}
if (!prelevement.conformite_limites_bact_prelevement) {
return ConformityEnum.NOT_TESTED;
if (!prelevement.conformite_references_bact_prelevement)
}
if (!prelevement.conformite_references_bact_prelevement) {
return ConformityEnum.NOT_TESTED;
}

const conformityLimitBacteriological =
prelevement.conformite_limites_bact_prelevement;
Expand Down

0 comments on commit d890fce

Please sign in to comment.