lib/middleware/content/validate.js
function validateContentType(cb) {
        if (!_.isUndefined(kontx.args.meta) && !_.isUndefined(kontx.args.meta.type)) {
            db.contentTypes.getById(kontx.args.meta.type.toString()).then(
                function(contentType) {
                    cb(null, contentType);
                },
                function() {
                    cb(createError(400, messages.invalid_content_type));
                });
        } else {
            cb(createError(400, messages.invalid_content_type));
        }

    }
function validateContentType(cb) {
        if (!_.isUndefined(kontx.args.meta) && !_.isUndefined(kontx.args.meta.type)) {
            db.contentTypes.getById(kontx.args.meta.type.toString()).then(
                function(contentType) {
                    cb(null, contentType);
                },
                function() {
                    cb(createError(400, messages.invalid_content_type));
                });
        } else {
            cb(createError(400, messages.invalid_content_type));
        }

    }
function validateContentType ( cb ) { if ( ! _ . isUndefined ( kontx . args . meta ) && ! _ . isUndefined ( kontx . args . meta . type ) ) { db . contentTypes . getById ( kontx . args . meta . type . toString ( ) ) . then ( function ( contentType ) { cb ( null , contentType ) ; } , function ( ) { cb ( createError ( 400 , messages . invalid_content_type ) ) ; } ) ; } else { cb ( createError ( 400 , messages . invalid_content_type ) ) ; } }
Function will test to see if the content type is in the system.
Function will test to see if the content type is in the system .