File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
packages/inspection-report/src/components/DamageReport/hooks Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -81,10 +81,12 @@ function getPictures(inspection) {
8181}
8282
8383function getPartPictures ( part , inspection ) {
84- const closeUps = inspection . images . filter ( ( image ) => (
85- image . image_type === 'close_up'
86- && image . detailed_viewpoint ?. centers_on . includes ( part . part_type )
87- ) ) ;
84+ const closeUpImageIds = inspection . parts
85+ . find ( ( value ) => value . part_type === part . part_type )
86+ ?. related_images . filter ( ( image ) => image . base_image_type === 'close_up' )
87+ . map ( ( image ) => image . base_image_type ) ;
88+ const closeUps = inspection . images
89+ . filter ( ( image ) => closeUpImageIds . includes ( image . base_image_id ) ) ;
8890 const beautyShotsWithDamages = inspection . images . filter ( ( image ) => (
8991 image . image_type === 'beauty_shot'
9092 && image . views ?. some ( ( view ) => view . element_id === part . id )
You can’t perform that action at this time.
0 commit comments