Skip to content

Commit

Permalink
chore: run format
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed-Hacene committed Sep 16, 2024
1 parent 81f875f commit 5103f26
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
6 changes: 1 addition & 5 deletions frontend/src/lib/components/SideBar/navData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ export const navData = {
name: 'calendar',
fa_icon: 'fa-solid fa-calendar-days',
href: '/calendar',
permissions: [
'view_appliedcontrol',
'view_riskacceptance',
'view_riskassessment',
]
permissions: ['view_appliedcontrol', 'view_riskacceptance', 'view_riskassessment']
}
]
},
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/lib/utils/crud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ export const URL_MODEL_MAP: ModelMap = {
verboseNamePlural: 'Domains',
listViewUrlParams: '?content_type=DO&content_type=GL',
foreignKeyFields: [{ field: 'parent_folder', urlModel: 'folders' }],
reverseForeignKeyFields: [{ field: 'folder', urlModel: 'projects' }, { field: 'folder', urlModel: 'entities' }]
reverseForeignKeyFields: [
{ field: 'folder', urlModel: 'projects' },
{ field: 'folder', urlModel: 'entities' }
]
},
projects: {
name: 'project',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/utils/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export const representativeSchema = z.object({
last_name: z.string().optional(),
phone: z.string().optional(),
role: z.string().optional(),
description: z.string().optional(),
description: z.string().optional()
});

const SCHEMA_MAP: Record<string, AnyZodObject> = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,19 @@ export const load = (async ({ fetch, params }) => {
})
);

const requirementAssessmentsById = requirement_assessments.reduce((acc, requirementAssessment) => {
acc[requirementAssessment.requirement] = requirementAssessment;
return acc;
}, {});

const requirements = tableMode.requirements.map(requirement => {
if (requirementAssessmentsById[requirement.id]) {
return requirementAssessmentsById[requirement.id]
}
return requirement;
const requirementAssessmentsById = requirement_assessments.reduce(
(acc, requirementAssessment) => {
acc[requirementAssessment.requirement] = requirementAssessment;
return acc;
},
{}
);

const requirements = tableMode.requirements.map((requirement) => {
if (requirementAssessmentsById[requirement.id]) {
return requirementAssessmentsById[requirement.id];
}
return requirement;
});

const schema = z.object({ id: z.string().uuid() });
Expand Down

0 comments on commit 5103f26

Please sign in to comment.