fix change api isPublic (#1008)

This commit is contained in:
Alex Christoffer Rasmussen
2024-05-27 13:01:10 +02:00
committed by GitHub
parent 345ea6722e
commit 9d04954d87
2 changed files with 3 additions and 4 deletions
@@ -23,14 +23,13 @@ const whitelistedPayload = {
export function parseProperty(property: string, value: unknown) {
if (property.startsWith('custom:')) {
const customKey = property.split(':')[1];
const customKey = property.split(':')[1].toLocaleLowerCase(); // all custom fields keys are lowercase
if (!(customKey in DataProvider.getCustomFields())) {
throw new Error(`Custom field ${customKey} not found`);
}
const parserFn = whitelistedPayload.custom;
return { custom: { [customKey]: parserFn(value) } };
}
if (!isKeyOfType(property, whitelistedPayload)) {
throw new Error(`Property ${property} not permitted`);
}