scoutfixed
This commit is contained in:
parent
8a3fe26358
commit
64324e011d
File diff suppressed because one or more lines are too long
@ -10,12 +10,8 @@ const ScoutingIndex = () => (
|
||||
<SectionTitleLineWithButton title="Scouting" main />
|
||||
<CardBox>
|
||||
<div className="flex flex-col space-y-4">
|
||||
<Link href="/scouting/new">
|
||||
<a className="btn btn-primary">Scout a Team</a>
|
||||
</Link>
|
||||
<Link href="/scouting/scouting-list">
|
||||
<a className="btn btn-secondary">View Scouting Data</a>
|
||||
</Link>
|
||||
<Link href="/scouting/new" className="btn btn-primary">Scout a Team</Link>
|
||||
<Link href="/scouting/scouting-list" className="btn btn-secondary">View Scouting Data</Link>
|
||||
</div>
|
||||
</CardBox>
|
||||
</SectionMain>
|
||||
|
||||
@ -34,7 +34,7 @@ const initialState: MainState = {
|
||||
|
||||
export const fetch = createAsyncThunk('scouting/fetch', async (data: any) => {
|
||||
const { id, query } = data;
|
||||
const result = await axios.get(`scouting${query || (id ? `/${id}` : '')}`);
|
||||
const result = await axios.get(`/api/scouting${query || (id ? `/${id}` : '')}`);
|
||||
return id
|
||||
? result.data
|
||||
: { rows: result.data.rows, count: result.data.count };
|
||||
@ -44,7 +44,7 @@ export const deleteItemsByIds = createAsyncThunk(
|
||||
'scouting/deleteByIds',
|
||||
async (data: any, { rejectWithValue }) => {
|
||||
try {
|
||||
await axios.post('scouting/deleteByIds', { data });
|
||||
await axios.post('/api/scouting/deleteByIds', { data });
|
||||
} catch (error) {
|
||||
if (!error.response) {
|
||||
throw error;
|
||||
@ -59,7 +59,7 @@ export const deleteItem = createAsyncThunk(
|
||||
'scouting/deleteScouting',
|
||||
async (id: string, { rejectWithValue }) => {
|
||||
try {
|
||||
await axios.delete(`scouting/${id}`);
|
||||
await axios.delete(`/api/scouting/${id}`);
|
||||
} catch (error) {
|
||||
if (!error.response) {
|
||||
throw error;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user