mirror of
https://gitlab.com/mobicoop/v3/service/configuration.git
synced 2026-02-01 21:00:44 +00:00
fix bad value assignment
This commit is contained in:
@@ -29,7 +29,12 @@ export class SetConfigurationService implements ICommandHandler {
|
|||||||
`${command.value}`,
|
`${command.value}`,
|
||||||
configurationType,
|
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(
|
return await this.configurationRepository.set(
|
||||||
command.configurationIdentifier.domain,
|
command.configurationIdentifier.domain,
|
||||||
command.configurationIdentifier.key,
|
command.configurationIdentifier.key,
|
||||||
|
|||||||
Reference in New Issue
Block a user