Skip to content

Commit 89ca54e

Browse files
committed
get audit edit id in report route and show back link on report page
1 parent 07b3448 commit 89ca54e

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

confiture-rest-api/src/audits/audit-report.dto.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
export class AuditReportDto {
99
/** Unique ID used to construct the report URL. */
1010
consultUniqueId: string;
11+
editUniqueId: string;
1112

1213
contactEmail?: string;
1314
contactFormUrl?: string;

confiture-rest-api/src/audits/audit.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,7 @@ export class AuditService {
727727

728728
const report: AuditReportDto = {
729729
consultUniqueId: audit.consultUniqueId,
730+
editUniqueId: audit.editUniqueId,
730731

731732
contactEmail: audit.contactEmail,
732733
contactFormUrl: audit.contactFormUrl,

confiture-web-app/src/pages/consult/ReportPage.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import PageMeta from "../../components/PageMeta";
1212
import BackLink from "../../components/BackLink.vue";
1313
import Dropdown from "../../components/Dropdown.vue";
1414
import { useWrappedFetch } from "../../composables/useWrappedFetch";
15-
import { useReportStore, useAuditStore } from "../../store";
15+
import { useReportStore } from "../../store";
1616
import { AuditType, AuditStatus } from "../../types";
1717
import {
1818
formatAuditType,
@@ -178,15 +178,14 @@ const siteUrl = computed(() => {
178178
</div>
179179
</div>
180180

181-
<!-- TODO: get editUniqueId from here -->
182-
<!-- <BackLink
181+
<BackLink
183182
:label="
184183
previousRoute.route?.name === 'account-dashboard'
185184
? 'Accéder à la synthèse'
186185
: 'Retourner à la synthèse'
187186
"
188-
:to="{ name: 'overview', params: { uniqueId: 'xxx' } }"
189-
/> -->
187+
:to="{ name: 'overview', params: { uniqueId: report.data?.editUniqueId } }"
188+
/>
190189

191190
<div class="fr-mb-4w heading">
192191
<h1 class="fr-mb-0">Rapport d’audit accessibilité</h1>

confiture-web-app/src/types/report.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { AuditType, CriteriumResult } from "../types";
22

33
export interface AuditReport {
44
consultUniqueId: string;
5+
editUniqueId: string;
56

67
contactEmail?: string;
78
contactFormUrl?: string;

0 commit comments

Comments
 (0)