feat: review project pseudonyms by category

This commit is contained in:
muena
2026-09-24 20:11:10 +02:00
parent 8b254eb87d
commit 226d230b6d
6 changed files with 242 additions and 127 deletions

View File

@@ -118,8 +118,7 @@ export async function pseudonymize(
body: JSON.stringify({
text,
mapping,
entity_types:
entityTypes && entityTypes.length > 0 ? entityTypes : undefined,
entity_types: entityTypes,
force_masks: forceMasks,
}),
});
@@ -163,11 +162,13 @@ export async function pseudonymizeDocument(
mapping: PlaceholderMapping,
forceMasks: Record<string, string[]>,
acceptedHitIds?: string[],
entityTypes?: EntityType[],
): Promise<DocumentResult> {
const form = new FormData();
form.set("file", new Blob([new Uint8Array(data)]), filename);
form.set("mapping", JSON.stringify(mapping));
form.set("force_masks", JSON.stringify(forceMasks));
if (entityTypes !== undefined) form.set("entity_types", JSON.stringify(entityTypes));
if (acceptedHitIds) form.set("accepted_hit_ids", JSON.stringify(acceptedHitIds));
const response = await fetchWithAuth(apiUrl("/api/pseudonymize-document"), {
method: "POST", body: form,