Merge branch 'fixBadvalue' into 'main'
Fix bad value assignment See merge request v3/service/configuration!35
This commit is contained in:
commit
41ed0fcec7
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@mobicoop/configuration",
|
||||
"version": "2.5.1",
|
||||
"version": "2.5.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@mobicoop/configuration",
|
||||
"version": "2.5.1",
|
||||
"version": "2.5.2",
|
||||
"license": "AGPL",
|
||||
"dependencies": {
|
||||
"@grpc/grpc-js": "^1.9.9",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@mobicoop/configuration",
|
||||
"version": "2.5.1",
|
||||
"version": "2.5.2",
|
||||
"description": "Mobicoop V3 Configuration Service",
|
||||
"author": "sbriat",
|
||||
"private": true,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue