Skip to content

Commit 8064944

Browse files
authored
EWC-331 restrict uuid field in iofog create endpoint (#331)
1 parent 143c2d4 commit 8064944

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/schemas/iofog.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ const iofogCreate = {
1515
"id": "/iofogCreate",
1616
"type": "object",
1717
"properties": {
18-
"uuid": {"type": "string"},
1918
"name": {"type": "string", "minLength": 1},
2019
"location": {"type": "string"},
2120
"latitude": {"type": "number", "minimum": -90, "maximum": 90},

src/services/iofog-service.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async function _createFog(fogData, user, isCli, transaction) {
2929
await Validator.validate(fogData, Validator.schemas.iofogCreate);
3030

3131
let createFogData = {
32-
uuid: fogData.uuid ? fogData.uuid : AppHelper.generateRandomString(32),
32+
uuid: AppHelper.generateRandomString(32),
3333
name: fogData.name,
3434
location: fogData.location,
3535
latitude: fogData.latitude,
@@ -52,7 +52,7 @@ async function _createFog(fogData, user, isCli, transaction) {
5252
abstractedHardwareEnabled: fogData.abstractedHardwareEnabled,
5353
fogTypeId: fogData.fogType,
5454
userId: user.id
55-
}
55+
};
5656
createFogData = AppHelper.deleteUndefinedFields(createFogData);
5757

5858
const fog = await FogManager.create(createFogData, transaction);

0 commit comments

Comments
 (0)