1
0
mirror of https://github.com/mgerb/go-discord-bot synced 2026-01-11 09:32:50 +00:00

build: eslint

This commit is contained in:
2022-03-29 00:35:45 -05:00
parent 9c57c87e85
commit 0532acfddd
22 changed files with 3332 additions and 1388 deletions

View File

@@ -1,4 +1,4 @@
import React from 'react';
import React, { ChangeEvent, FormEvent } from 'react';
import { IUser } from '../../model';
import { UserService } from '../../services/user.service';
@@ -7,8 +7,8 @@ interface IState {
showSavedMessage: boolean;
}
export class Users extends React.Component<any, IState> {
constructor(props: any) {
export class Users extends React.Component<unknown, IState> {
constructor(props: unknown) {
super(props);
this.state = {
users: [],
@@ -22,10 +22,10 @@ export class Users extends React.Component<any, IState> {
});
}
onUserChange = (type: 'permissions' | 'voice_join_sound', event: any, index: number) => {
onUserChange = (type: 'permissions' | 'voice_join_sound', event: ChangeEvent<HTMLInputElement>, index: number) => {
this.setState({ showSavedMessage: false });
let users = [...this.state.users];
const users = [...this.state.users];
const val = type === 'permissions' ? parseInt(event.target.value) : event.target.value;
users[index] = {
...users[index],
@@ -64,7 +64,7 @@ export class Users extends React.Component<any, IState> {
});
};
save = (event: any) => {
save = (event: FormEvent<HTMLFormElement>) => {
this.setState({ showSavedMessage: false });
event.preventDefault();
UserService.putUsers(this.state.users).then((users: IUser[]) => {