-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
3,506 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
/.pnp | ||
.pnp.js | ||
|
||
/config | ||
|
||
# testing | ||
/coverage | ||
|
||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { createAsyncThunk, createSlice, createEntityAdapter } from "@reduxjs/toolkit"; | ||
|
||
import { action_status } from '../constants'; | ||
import api from '../api'; | ||
|
||
const employersAdaper = createEntityAdapter(); | ||
|
||
const initialState = employersAdaper.getInitialState({ | ||
status: action_status.IDLE, | ||
error: null | ||
}); | ||
|
||
export const getEmployers = createAsyncThunk( | ||
'employers/getEmployers', | ||
async () => { | ||
const { data } = await api.get(`/employer`); | ||
|
||
return data; | ||
} | ||
); | ||
|
||
const employerslice = createSlice({ | ||
name: 'employers', | ||
initialState, | ||
reducers: { | ||
}, | ||
extraReducers: (builder) => { | ||
builder | ||
.addCase(getEmployers.pending, (state, action) => { | ||
state.status = action_status.LOADING; | ||
}) | ||
.addCase(getEmployers.fulfilled, (state, action) => { | ||
state.status = action_status.SUCCEEDED; | ||
employersAdaper.setAll(state, action.payload.employers); | ||
}) | ||
.addCase(getEmployers.rejected, (state, action) => { | ||
state.status = action_status.FAILED; | ||
state.error = action.error; | ||
}) | ||
} | ||
}); | ||
|
||
export const { | ||
selectAll: selectAllEmployers, | ||
selectById: selectEmpployerById, | ||
selectIds: selectEmpployerIds | ||
} = employersAdaper.getSelectors((state) => state.employers); | ||
|
||
const { reducer } = employerslice; | ||
|
||
export default reducer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { createAsyncThunk, createSlice, createEntityAdapter } from "@reduxjs/toolkit"; | ||
|
||
import { action_status } from '../constants'; | ||
import api from '../api'; | ||
|
||
const freelancersAdaper = createEntityAdapter(); | ||
|
||
const initialState = freelancersAdaper.getInitialState({ | ||
status: action_status.IDLE, | ||
error: null | ||
}); | ||
|
||
export const getFreelancers = createAsyncThunk( | ||
'freelancers/getFreelancers', | ||
async () => { | ||
const { data } = await api.get(`/freelancer`); | ||
|
||
return data; | ||
} | ||
); | ||
|
||
const freelancerslice = createSlice({ | ||
name: 'freelancers', | ||
initialState, | ||
reducers: { | ||
}, | ||
extraReducers: (builder) => { | ||
builder | ||
.addCase(getFreelancers.pending, (state, action) => { | ||
state.status = action_status.LOADING; | ||
}) | ||
.addCase(getFreelancers.fulfilled, (state, action) => { | ||
state.status = action_status.SUCCEEDED; | ||
freelancersAdaper.setAll(state, action.payload.freelancers); | ||
}) | ||
.addCase(getFreelancers.rejected, (state, action) => { | ||
state.status = action_status.FAILED; | ||
state.error = action.error; | ||
}) | ||
} | ||
}); | ||
|
||
export const { | ||
selectAll: selectAllFreelancers, | ||
selectById: selectFreelancerById, | ||
selectIds: selectFreelancerIds | ||
} = freelancersAdaper.getSelectors((state) => state.freelancers); | ||
|
||
const { reducer } = freelancerslice; | ||
|
||
export default reducer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.