{lastScan && lastScan.status &&
}
diff --git a/web/src/scans/scannerUtil.js b/web/src/scans/scannerUtil.js
index a061f006..a05266d0 100644
--- a/web/src/scans/scannerUtil.js
+++ b/web/src/scans/scannerUtil.js
@@ -8,10 +8,12 @@ export const getScanResult = (scan) => {
case undefined:
return undefined;
case 201:
- return { message: 'Scan Accepted', color: green['A700'], icon:
};
- case 200:
- return { message: 'Duplicate Scan', color: yellow['A700'], icon:
};
+ return { accepted: true, message: 'Scan Accepted', color: green['A700'], icon:
};
+ case 403:
+ return { accepted: false, message: 'The Veteran has not checked in for this Event.', color: red['A700'], icon:
};
+ case 409:
+ return { accepted: false, message: 'Duplicate Scan', color: yellow['A700'], icon:
};
default:
- return { message: scan.response, color: red['A700'], icon:
};
+ return { accepted: false, message: scan.response, color: red['A700'], icon:
};
}
};
\ No newline at end of file
diff --git a/web/src/shared/ContextProvider.js b/web/src/shared/ContextProvider.js
index 735ca22d..e63e4b5c 100644
--- a/web/src/shared/ContextProvider.js
+++ b/web/src/shared/ContextProvider.js
@@ -29,6 +29,10 @@ class ContextProvider extends Component {
if (error.response && error.response.data) {
if (error.response.status === 500) {
this.showMessage(error.response.data.Message);
+ } else if (error.response.data.error) {
+ this.showMessage(error.response.data.error.message);
+ } else if (error.response.data.message) {
+ this.showMessage(error.response.data.message);
} else {
this.showMessage(error.response.data);
}