Fix complexity warnings in user routes
This commit is contained in:
parent
8f730b8270
commit
9c128b8c10
4 changed files with 31 additions and 51 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue