Fix complexity warnings in user routes

This commit is contained in:
Bill Thornton 2023-04-26 12:32:15 -04:00
parent 8f730b8270
commit 9c128b8c10
4 changed files with 31 additions and 51 deletions

View file

@ -215,12 +215,8 @@ const UserParentalControl: FunctionComponent = () => {
};
const saveUser = (user: UserDto) => {
if (!user.Id) {
throw new Error('Unexpected null user.Id');
}
if (!user.Policy) {
throw new Error('Unexpected null user.Policy');
if (!user.Id || !user.Policy) {
throw new Error('Unexpected null user id or policy');
}
const parentalRating = parseInt((page.querySelector('#selectMaxParentalRating') as HTMLSelectElement).value, 10);