@@ -6,6 +6,7 @@ import { merge } from 'lodash';
66
77const Ajv = require ( 'ajv' ) ; // json validator
88const fs = require ( 'fs' ) ;
9+ const path = require ( 'path' ) ;
910
1011function addUserGroupToken ( config , result ) {
1112 /**
@@ -36,7 +37,7 @@ export default ({config, db}) => {
3637 const ajv = new Ajv ( ) ;
3738 const userRegisterSchema = require ( '../models/userRegister.schema.json' )
3839 let userRegisterSchemaExtension = { } ;
39- if ( fs . existsSync ( '../models/userRegister.schema.extension.json' ) ) {
40+ if ( fs . existsSync ( path . resolve ( __dirname , '../models/userRegister.schema.extension.json' ) ) ) {
4041 userRegisterSchemaExtension = require ( '../models/userRegister.schema.extension.json' ) ;
4142 }
4243 const validate = ajv . compile ( merge ( userRegisterSchema , userRegisterSchemaExtension ) )
@@ -169,7 +170,7 @@ export default ({config, db}) => {
169170 const ajv = new Ajv ( ) ;
170171 const userProfileSchema = require ( '../models/userProfile.schema.json' )
171172 let userProfileSchemaExtension = { } ;
172- if ( fs . existsSync ( '../models/userProfile.schema.extension.json' ) ) {
173+ if ( fs . existsSync ( path . resolve ( __dirname , '../models/userProfile.schema.extension.json' ) ) ) {
173174 userProfileSchemaExtension = require ( '../models/userProfile.schema.extension.json' ) ;
174175 }
175176 const validate = ajv . compile ( merge ( userProfileSchema , userProfileSchemaExtension ) )
0 commit comments