change to using fetch over jquery
This commit is contained in:
parent
c3a35c07a4
commit
74c9da684f
|
@ -58,7 +58,6 @@ input:focus {
|
|||
.cl_league_structure_table {
|
||||
display: table;
|
||||
margin-right: 1rem;
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
.cl_headers, .cl_table_row {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import React, {useState, useRef, useLayoutEffect, useReducer} from 'react';
|
||||
import './CreateLeague.css';
|
||||
import twemoji from 'twemoji';
|
||||
import $, {getJSON} from 'jquery';
|
||||
|
||||
interface LeagueStructureState {
|
||||
subleagues: SubleagueState[]
|
||||
|
@ -262,10 +261,9 @@ function Division(props: {state: DivisionState, dispatch:(action: DistributiveOm
|
|||
<input type="text" className="cl_newteam_name" placeholder="Add team..." value={newName} ref={newNameInput}
|
||||
onChange={e => {
|
||||
let params = new URLSearchParams({query: e.target.value, page_len: '5', page_num: '0'});
|
||||
$.getJSON("/api/teams/search?" + params.toString(), data => {
|
||||
console.log(data);
|
||||
setSearchResults(data);
|
||||
})
|
||||
fetch("/api/teams/search?" + params.toString())
|
||||
.then(response => response.json())
|
||||
.then(data => setSearchResults(data));
|
||||
setNewName(e.target.value);
|
||||
}}/>
|
||||
</div>
|
||||
|
|
|
@ -7,9 +7,7 @@ import GamePage from './GamePage';
|
|||
import CreateLeague from './CreateLeague';
|
||||
import discordlogo from "./img/discord.png";
|
||||
import reportWebVitals from './reportWebVitals';
|
||||
import $ from 'jquery'
|
||||
|
||||
$(document).ready(function() {
|
||||
ReactDOM.render(
|
||||
<React.StrictMode>
|
||||
<Router>
|
||||
|
@ -23,7 +21,6 @@ $(document).ready(function() {
|
|||
</React.StrictMode>,
|
||||
document.getElementById('root')
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
function Header() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user