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 />
|
<SectionTitleLineWithButton title="Scouting" main />
|
||||||
<CardBox>
|
<CardBox>
|
||||||
<div className="flex flex-col space-y-4">
|
<div className="flex flex-col space-y-4">
|
||||||
<Link href="/scouting/new">
|
<Link href="/scouting/new" className="btn btn-primary">Scout a Team</Link>
|
||||||
<a className="btn btn-primary">Scout a Team</a>
|
<Link href="/scouting/scouting-list" className="btn btn-secondary">View Scouting Data</Link>
|
||||||
</Link>
|
|
||||||
<Link href="/scouting/scouting-list">
|
|
||||||
<a className="btn btn-secondary">View Scouting Data</a>
|
|
||||||
</Link>
|
|
||||||
</div>
|
</div>
|
||||||
</CardBox>
|
</CardBox>
|
||||||
</SectionMain>
|
</SectionMain>
|
||||||
|
|||||||
@ -34,7 +34,7 @@ const initialState: MainState = {
|
|||||||
|
|
||||||
export const fetch = createAsyncThunk('scouting/fetch', async (data: any) => {
|
export const fetch = createAsyncThunk('scouting/fetch', async (data: any) => {
|
||||||
const { id, query } = data;
|
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
|
return id
|
||||||
? result.data
|
? result.data
|
||||||
: { rows: result.data.rows, count: result.data.count };
|
: { rows: result.data.rows, count: result.data.count };
|
||||||
@ -44,7 +44,7 @@ export const deleteItemsByIds = createAsyncThunk(
|
|||||||
'scouting/deleteByIds',
|
'scouting/deleteByIds',
|
||||||
async (data: any, { rejectWithValue }) => {
|
async (data: any, { rejectWithValue }) => {
|
||||||
try {
|
try {
|
||||||
await axios.post('scouting/deleteByIds', { data });
|
await axios.post('/api/scouting/deleteByIds', { data });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (!error.response) {
|
if (!error.response) {
|
||||||
throw error;
|
throw error;
|
||||||
@ -59,7 +59,7 @@ export const deleteItem = createAsyncThunk(
|
|||||||
'scouting/deleteScouting',
|
'scouting/deleteScouting',
|
||||||
async (id: string, { rejectWithValue }) => {
|
async (id: string, { rejectWithValue }) => {
|
||||||
try {
|
try {
|
||||||
await axios.delete(`scouting/${id}`);
|
await axios.delete(`/api/scouting/${id}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (!error.response) {
|
if (!error.response) {
|
||||||
throw error;
|
throw error;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user