fix bad value assignment

This commit is contained in:
Sylvain Briat
2023-11-16 10:31:20 +01:00
parent b33cf3b041
commit 7dcc965f4d

View File

@@ -29,7 +29,12 @@ export class SetConfigurationService implements ICommandHandler {
`${command.value}`,
configurationType,
);
if (isNaN(value)) throw new ArgumentInvalidException('Bad value');
if (
(configurationType === ConfigurationType.INT ||
configurationType === ConfigurationType.FLOAT) &&
isNaN(value)
)
throw new ArgumentInvalidException('Bad value');
return await this.configurationRepository.set(
command.configurationIdentifier.domain,
command.configurationIdentifier.key,