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",
|
"name": "@mobicoop/configuration",
|
||||||
"version": "2.5.1",
|
"version": "2.5.2",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@mobicoop/configuration",
|
"name": "@mobicoop/configuration",
|
||||||
"version": "2.5.1",
|
"version": "2.5.2",
|
||||||
"license": "AGPL",
|
"license": "AGPL",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@grpc/grpc-js": "^1.9.9",
|
"@grpc/grpc-js": "^1.9.9",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@mobicoop/configuration",
|
"name": "@mobicoop/configuration",
|
||||||
"version": "2.5.1",
|
"version": "2.5.2",
|
||||||
"description": "Mobicoop V3 Configuration Service",
|
"description": "Mobicoop V3 Configuration Service",
|
||||||
"author": "sbriat",
|
"author": "sbriat",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue