-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into Nahiyan_Dropdown-items-in-dark-mode
- Loading branch information
Showing
139 changed files
with
3,807 additions
and
2,332 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
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,73 @@ | ||
import * as types from '../constants/BluequareEmailBccConstants'; | ||
import axios from 'axios'; | ||
import { ENDPOINTS } from '../utils/URL'; | ||
import { toast } from 'react-toastify'; | ||
|
||
const getAllBlueSquareEmailBccs = allAssignements => ({ | ||
type: types.GET_BLUE_SQUARE_EMAIL_ASSIGNMENTS, | ||
payload: allAssignements, | ||
}); | ||
|
||
const setBlueSquareEmailBcc = emailAssignement => ({ | ||
type: types.SET_BLUE_SQUARE_EMAIL_ASSIGNMENT, | ||
payload: emailAssignement, | ||
}); | ||
|
||
const deleteBlueSquareEmailBcc = id => ({ | ||
type: types.DELETE_BLUE_SQUARE_EMAIL_ASSIGNMENT, | ||
payload: id, | ||
}); | ||
|
||
const blueSquareEmailBccError = error => ({ | ||
type: types.BLUE_SQUARE_EMAIL_ASSIGNMENT_ERROR, | ||
payload: error, | ||
}); | ||
|
||
export const getAllBlueSquareEmailAssignements = () => { | ||
const url = ENDPOINTS.BLUE_SQUARE_EMAIL_BCC(); | ||
return async dispatch => { | ||
try { | ||
const response = await axios.get(url); | ||
if (response.status === 200) { | ||
dispatch(getAllBlueSquareEmailBccs(response.data)); | ||
} else { | ||
dispatch(blueSquareEmailBccError(response.data)); | ||
} | ||
} catch (err) { | ||
dispatch(blueSquareEmailBccError(err)); | ||
} | ||
}; | ||
}; | ||
|
||
export const setBlueSquareEmailAssignement = email => { | ||
const url = ENDPOINTS.BLUE_SQUARE_EMAIL_BCC(); | ||
return async dispatch => { | ||
try { | ||
const response = await axios.post(url, {email}); | ||
if (response.status === 200) { | ||
dispatch(setBlueSquareEmailBcc(response.data)); | ||
} else { | ||
dispatch(blueSquareEmailBccError(response.data)); | ||
} | ||
} catch (err) { | ||
dispatch(blueSquareEmailBccError(err)); | ||
} | ||
}; | ||
}; | ||
|
||
export const deleteBlueSquareEmailAssignement = id => { | ||
const url = ENDPOINTS.DELETE_BLUE_SQUARE_EMAIL_BCC(id); | ||
return async dispatch => { | ||
try { | ||
const response = await axios.delete(url); | ||
if (response.status === 200) { | ||
console.log(response.data) | ||
dispatch(deleteBlueSquareEmailBcc(response.data.id)); | ||
} else { | ||
dispatch(blueSquareEmailBccError(response.data)); | ||
} | ||
} catch (err) { | ||
dispatch(blueSquareEmailBccError(err)); | ||
} | ||
}; | ||
}; |
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.