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

Trie les audits du dashboard par date de création descendante #821

Merged
merged 3 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Tous les changements notables de Ara sont documentés ici avec leur date, leur c
### Corrections 🐛

- Ordonne correctement les pages dans la déclaration d’accessibilité et le contexte de l’audit ([#819](https://github.com/DISIC/Ara/pull/819))
- Ordonne les audits du tableau de bord par date de création descendante (du plus récent au plus ancien) ([#821](https://github.com/DISIC/Ara/pull/821))

## 31/10/2024

Expand Down
6 changes: 4 additions & 2 deletions confiture-rest-api/src/audits/audit.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from "@prisma/client";
import { nanoid } from "nanoid";
import sharp from "sharp";
import { omit, pick, setWith, sortBy, uniqBy } from "lodash";
import { omit, orderBy, pick, sortBy, setWith, uniqBy } from "lodash";

import { PrismaService } from "../prisma.service";
import * as RGAA from "../rgaa.json";
Expand Down Expand Up @@ -1366,7 +1366,7 @@ export class AuditService {
}
});

return audits.map((a) => {
const unorderedAudits = audits.map((a) => {
const results = [
...a.transverseElementsPage.results,
...a.pages.flatMap((p) => p.results)
Expand Down Expand Up @@ -1437,5 +1437,7 @@ export class AuditService {
statementIsPublished
};
});

return orderBy(unorderedAudits, (a) => a.creationDate, ["desc"]);
}
}
Loading