Skip to content

Conversation

gabrieltmonkai
Copy link
Contributor

@gabrieltmonkai gabrieltmonkai commented Oct 8, 2025

Overview

Jira Ticket Reference : MN-780

Added a new deleteImage function to handle image deletion of an inspection.

Checklist before requesting a review

  • I have updated the unit tests based on the changes I made
  • I have updated the docs (TSDoc / README / global doc) to reflect my changes
  • I have updated the local app configs if needed
  • I have performed self-QA of my feature by testing the apps and packages and made sure that :
    • No regression or new bug has occurred
    • The acceptance criteria listed in the ticket are met
    • Self-QA was made on both desktop and mobile

const newImages = images.filter((image) => image.id !== payload.imageId);
return {
...state,
images: [...newImages],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete the imageID for the following object:

  • Damages
  • Parts
  • renderedOutputs
  • views

@gabrieltmonkai gabrieltmonkai force-pushed the feat/MN-780/create-deleteImage-api branch from 3ab10ff to 4121c7f Compare October 9, 2025 14:14
}
const newImages = images.filter((image) => image.id !== payload.imageId);
const newDamages = damages.filter((damage) => !damage.relatedImages.includes(payload.imageId));
const newParts = parts.filter((part) => !part.relatedImages.includes(payload.imageId));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will removed every part that have a deleted image ID related to it, we don't want that.
We want to only remove the id in the relatedImages array.

@gabrieltmonkai gabrieltmonkai force-pushed the feat/MN-780/create-deleteImage-api branch 6 times, most recently from 0d71d60 to 0788148 Compare October 16, 2025 10:31
Reset state objects containing the deleted image

Updated objects to be deleted in State

Updated API export and added more tests

Added docs
@gabrieltmonkai gabrieltmonkai force-pushed the feat/MN-780/create-deleteImage-api branch from 0788148 to cf49a7c Compare October 16, 2025 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants