Skip to content

Commit

Permalink
Merge pull request #583 from ECLK/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
MrClemRkz authored Aug 4, 2020
2 parents b82e9a0 + cd79a58 commit 46770d4
Show file tree
Hide file tree
Showing 5 changed files with 1,290 additions and 9 deletions.
2 changes: 1 addition & 1 deletion backend/src/reporting/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ReportingAccessView(APIView):
Response would be a pdf stream to be opened in a different tab
'''
permission_classes = []
# permission_classes = []
def get(self, request):
endpoint_uri = settings.PDF_SERVICE_ENDPOINT
json_dict = {}
Expand Down
13 changes: 9 additions & 4 deletions frontend/src/api/apiHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@ handler.interceptors.response.use(function (response) {
// Any status codes that falls outside the range of 2xx cause this function to trigger

// handling session expire
if (error.response.status == 401 && error.response.data.data.message == "Signature has expired."){
signOut()
} else if (error.response.status == 400 && error.response.data.data.non_field_errors.includes("Signature has expired.")){
signOut()
if (error.response.status != undefined) {
if (error.response.status == 401 && error.response.data.data.message == "Signature has expired."){
signOut()
} else if (error.response.status == 400 && error.response.data.data.non_field_errors.includes("Signature has expired.")){
signOut()
}
} else {
console.log(error.response);
console.log("<---- This is an anchor message ---->")
}
return Promise.reject(error);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ function IncidentFormInternal(props) {
<Grid item xs={12} sm={3}>
<TextField
id="receivedDate"
label="Received date"
label="Received date*"
type="date"
value={values.receivedDate}
InputLabelProps={{ shrink: true }}
Expand All @@ -1027,7 +1027,7 @@ function IncidentFormInternal(props) {
<Grid item xs={12} sm={3}>
<TextField
id="letterDate"
label="Letter date"
label="Letter date*"
type="date"
value={values.letterDate}
InputLabelProps={{ shrink: true }}
Expand Down Expand Up @@ -1075,7 +1075,7 @@ function IncidentFormInternal(props) {
<FormControl
error={touched.institution && errors.institution}
className={classes.formControl}>
Institution
Institution*
</FormControl>
<Search
institutions={institutions}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/reporting/components/ReportViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const ReportViewer = ({ classes, ...props }) => {

useEffect(() => {
const values = queryString.parse(props.location.search);
loadPDF(API_BASE_URL + "/pdfgen/?template_type=" + values.template_type +
loadPDF(API_BASE_URL + "/reports/?template_type=" + values.template_type +
"&start_date=" + values.start_date +
"&end_date=" + values.end_date +
"&detailed_report=" + values.detailed_report +
Expand Down
Loading

0 comments on commit 46770d4

Please sign in to comment.