Skip to content

Commit

Permalink
Fixed issues reported on wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahender Reddy Jangari committed Apr 28, 2023
1 parent abc3bb3 commit 2406f33
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion src/redux/actions/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1869,6 +1869,8 @@ export const updatePubFiltersFromSearch = () => {
// Search Results for Create Reports Page
export const getReportsResults = (requestBody, paginationUpdate = false) => dispatch => {
// check if fetching different page of the same results and update loading state accordingly
console.log("getReportsResults")

if (paginationUpdate) {
dispatch({
type: methods.REPORTS_SEARCH_PAGINATED_FETCHING
Expand Down Expand Up @@ -1999,14 +2001,15 @@ export const getReportsResults = (requestBody, paginationUpdate = false) => disp

// Default Data for Create Reports Page
export const getReportsResultsInitial = (limit = 20, offset = 0) => dispatch => {
console.log("getReportsResultsInitial")
dispatch({
type: methods.REPORTS_SEARCH_FETCHING
})

// set the search filters to get results from the last 30 days and sorted by date
let startDate = new Date();
let endDate = new Date();
startDate.setDate(endDate.getDate() - 30);
// startDate.setDate(endDate.getDate() - 30);
// let filters = {"datePublicationAddedToEntrezLowerBound" : new Date(startDate).toISOString().slice(0,10)};
let filters = {};
fetch(`/api/db/reports/publication/search`, {
Expand Down Expand Up @@ -2257,3 +2260,35 @@ export const adminSettingsListAction = (adminSettingsList) => dispatch => {
payload: adminSettingsList
})
}

export const sendNotification = (toEmail, body, subject) =>{
return fetch(`/api/notification`, {
credentials: "same-origin",
method: 'POST',
headers: {
Accept: 'application/json',
"Content-Type": "application/json",
'Authorization': reciterConfig.backendApiKey
},
body: ""
})
.then(response => {
if (response.status === 200) {
return response.json()
} else {
// throw {
// type: response.type,
// title: response.statusText,
// status: response.status,
// detail: "Error occurred with api " + response.url + ". Please, try again later "
// }
}
})
.then(data => {
console.log("dataa is ", data)
// return data
})
.catch(error => {
console.log(error)
})
}

0 comments on commit 2406f33

Please sign in to comment.