Fix using keys instead of values

Also add `logger.debug` call with keys from API response
This commit is contained in:
Michael B. Gale
2025-09-23 09:12:16 +01:00
parent 40262b1861
commit 07920e84f8
2 changed files with 12 additions and 3 deletions
+8 -2
View File
@@ -50,7 +50,11 @@ export async function loadPropertiesFromApi(
);
}
const knownProperties = new Set(Object.keys(RepositoryPropertyName));
logger.debug(
`Retrieved ${remoteProperties.length} repository properties: ${remoteProperties.map((p) => p.property_name).join(", ")}`,
);
const knownProperties = new Set(Object.values(RepositoryPropertyName));
const properties: RepositoryProperties = {};
for (const property of remoteProperties) {
if (property.property_name === undefined) {
@@ -59,7 +63,9 @@ export async function loadPropertiesFromApi(
);
}
if (knownProperties.has(property.property_name)) {
if (
knownProperties.has(property.property_name as RepositoryPropertyName)
) {
properties[property.property_name] = property.value;
}
}