Skip to content

Commit

Permalink
feat: update read view of a requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed-Hacene committed Nov 29, 2024
1 parent ea572b1 commit 867dbed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,8 @@ export const load = (async ({ fetch, params }) => {
const complianceAssessmentScore = await fetch(
`${BASE_API_URL}/compliance-assessments/${requirementAssessment.compliance_assessment.id}/global_score/`
).then((res) => res.json());
const requirement = await fetch(
`${BASE_API_URL}/requirement-nodes/${requirementAssessment.requirement}/`
).then((res) => res.json());
const parentRequirementNodeEndpoint = `${BASE_API_URL}/requirement-nodes/?urn=${requirement.parent_urn}`;
const parent = await fetch(parentRequirementNodeEndpoint)
.then((res) => res.json())
.then((res) => res.results[0]);
const requirement = requirementAssessment.requirement;
const parent = requirementAssessment.requirement.parent_requirement;

const tables: Record<string, any> = {};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
import { page } from '$app/stores';
export let data: PageData;
const threats = data.requirement.threats;
const reference_controls = data.requirement.reference_controls;
const threats = data.requirementAssessment.requirement.associated_threats ?? [];
const reference_controls =
data.requirementAssessment.requirement.associated_reference_controls ?? [];
const annotation = data.requirement.annotation;
const typical_evidence = data.requirement.typical_evidence;
const has_threats = threats && threats.length > 0;
const has_reference_controls = reference_controls && reference_controls.length > 0;
const has_threats = threats.length > 0;
const has_reference_controls = reference_controls.length > 0;
$: mappingInference = {
sourceRequirementAssessment:
Expand Down

0 comments on commit 867dbed

Please sign in to comment.