material and activeModelIndex fix
This commit is contained in:
@ -17,7 +17,7 @@ export class DataService {
|
||||
) { }
|
||||
|
||||
private collectionMap = {
|
||||
materials: {path: '/materials?status=all', model: MaterialModel, type: 'idArray'},
|
||||
materials: {path: '/materials?status[]=validated&status[]=new', model: MaterialModel, type: 'idArray'},
|
||||
materialSuppliers: {path: '/material/suppliers', model: null, type: 'idArray'},
|
||||
materialGroups: {path: '/material/groups', model: null, type: 'idArray'},
|
||||
materialTemplates: {path: '/template/materials', model: TemplateModel, type: 'template'},
|
||||
|
@ -11,6 +11,7 @@ import {DataService} from './data.service';
|
||||
export class LoginService implements CanActivate {
|
||||
|
||||
private pathPermissions = [
|
||||
{path: 'materials', permission: 'dev'},
|
||||
{path: 'templates', permission: 'dev'},
|
||||
{path: 'changelog', permission: 'dev'},
|
||||
{path: 'users', permission: 'admin'}
|
||||
|
@ -71,6 +71,14 @@ export class ValidationService {
|
||||
return {ok: true, error: ''};
|
||||
}
|
||||
|
||||
stringNin(data, list) {
|
||||
const {ignore, error} = Joi.string().invalid(...list).validate(data);
|
||||
if (error) {
|
||||
return {ok: false, error: 'value not allowed'};
|
||||
}
|
||||
return {ok: true, error: ''};
|
||||
}
|
||||
|
||||
stringLength(data, length) {
|
||||
const {ignore, error} = Joi.string().max(length).allow('').validate(data);
|
||||
if (error) {
|
||||
|
Reference in New Issue
Block a user