Skip to content

Commit c4e3467

Browse files
committed
T426 : add 'media' type
1 parent c4285c1 commit c4e3467

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

  • server/controllers/things/models/types
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const CONFIG = require('config')
2+
const __ = CONFIG.universalPath
3+
const _ = __.require('lib', 'utils')
4+
const error_ = __.require('lib', 'error')
5+
6+
module.exports = {
7+
validateData: function (data) {
8+
if (!_.isNonEmptyString(data.name)) {
9+
throw error_.new('Name attribute missing.', 400, data)
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)