Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
Remove duplicates from response
Browse files Browse the repository at this point in the history
  • Loading branch information
LWJerri committed Jan 14, 2024
1 parent bf4403d commit 465b96b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/custom/extractid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ export function ExtractIdTab() {

const getDataFromSource = sourceValue.match(AVAILABLE_CHOICES[value].regexp);

if (getDataFromSource?.length) {
setExtractedValues(getDataFromSource);
}
setExtractedValues(getDataFromSource?.length ? [...new Set(getDataFromSource)] : []);
};

return (
Expand Down Expand Up @@ -60,11 +58,13 @@ export function ExtractIdTab() {
</div>

<div className={`space-y-2 ${extractedValues.length ? "block" : "hidden"}`}>
<Label htmlFor="result">Result of extracting</Label>
<Label htmlFor="result">Result of extracting*</Label>

<div id="result">
<Markup content={extractedValues.join("<br />")} />
</div>

<p className="text-xs text-gray-500">*Duplicate codes have been deleted</p>
</div>
</div>
</CardContent>
Expand Down

0 comments on commit 465b96b

Please sign in to comment.