Skip to content

Commit 1d06a9c

Browse files
committed
update
1 parent 412b524 commit 1d06a9c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/configuration/apiCommunicationUtils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ApiCommunication, Topic } from './parsedApiConfigurationTypes';
33
// Définir un type plus large pour couvrir les cas transformés depuis le XML
44
export type RawCommunication = {
55
attributes?: Partial<ApiCommunication['attributes']>;
6-
topic?: { value?: string } | { value?: string }[];
6+
topic?: { value?: string; type?: string } | { value?: string; type?: string }[];
77
};
88

99
export function normalizeCommunication(input: RawCommunication): ApiCommunication {
@@ -21,15 +21,15 @@ export function normalizeCommunication(input: RawCommunication): ApiCommunicatio
2121
};
2222
}
2323

24-
function normalizeTopic(topic: { value?: string } | { value?: string }[] | undefined): [Topic] {
24+
function normalizeTopic(topic: { value?: string; type?: string } | { value?: string; type?: string }[] | undefined): [Topic] {
2525
if (!topic) {
2626
return [{ value: '' }];
2727
}
2828

2929
if (Array.isArray(topic)) {
30-
const normalized = topic.map((t): Topic => ({ value: t.value ?? '' }));
30+
const normalized = topic.map((t): Topic => ({ value: t.value ?? t.type ?? '' }));
3131
return normalized.length > 0 ? [normalized[0]] : [{ value: '' }];
3232
}
3333

34-
return [{ value: topic.value ?? '' }];
34+
return [{ value: topic.value ?? topic.type ?? '' }];
3535
}

0 commit comments

Comments
 (0)