14 lines
497 B
JavaScript
14 lines
497 B
JavaScript
import markTypes from '../config/markTypes.js';
|
|
import { AppErrorInvalid } from './errors.js';
|
|
|
|
export const technicalMarkTypes = [markTypes.IMPLEMENTATION, markTypes.WORK];
|
|
export function expertRole(value = 'expert') {
|
|
if (!['expert', 'technical'].includes(value)) throw new AppErrorInvalid('role');
|
|
return value;
|
|
}
|
|
export function editableMarkTypes(role) {
|
|
return role === 'technical'
|
|
? technicalMarkTypes
|
|
: Object.values(markTypes).filter(type => !technicalMarkTypes.includes(type));
|
|
}
|