Skip to content

Commit

Permalink
Merge pull request #423 from bcgov/mals-1240
Browse files Browse the repository at this point in the history
MALS-1240
  • Loading branch information
barrfalk authored Oct 19, 2023
2 parents e8a7412 + acbefc0 commit e8425dc
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# These users will be the default owners for everything in the repo.
# Unless a later match takes precedence, the following users will be
# requested for review when someone opens a pull request.
* @kamorel
* @barrfalk
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default function ApiaryInspectionDetailsView({ inspection, site }) {
<Form.Label>Other</Form.Label>
<Form.Control
disabled
value={inspection.otherResultDescription}
value={inspection.otherResultDescription ?? ""}
as="textarea"
rows={8}
name="otherResultDescription"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export default function InspectionDetailsViewEdit({
setValue("broodTested", inspection.data.broodTested);
setValue("varroaTested", inspection.data.varroaTested);
setValue("smallHiveBeetleTested", inspection.data.smallHiveBeetleTested);
setValue("smallHiveBeetleResult", inspection.data.smallHiveBeetleResult);
setValue(
"americanFoulbroodResult",
inspection.data.americanFoulbroodResult
Expand Down Expand Up @@ -110,6 +111,7 @@ export default function InspectionDetailsViewEdit({
inspection.data.broodTested,
inspection.data.varroaTested,
inspection.data.smallHiveBeetleTested,
inspection.data.smallHiveBeetleResult,
inspection.data.americanFoulbroodResult,
inspection.data.europeanFoulbroodResult,
inspection.data.chalkbroodResult,
Expand Down Expand Up @@ -176,7 +178,7 @@ export default function InspectionDetailsViewEdit({
varroaMiteResult: parseAsInt(data.varroaMiteResult),
varroaMiteResultPercent: parseAsFloat(data.varroaMiteResultPercent),
otherResultDescription:
data.otherResultDescription.length === 0
data.otherResultDescription?.length === 0
? null
: data.otherResultDescription,
supersInspected: parseAsInt(data.supersInspected),
Expand Down
2 changes: 0 additions & 2 deletions app/client/src/utilities/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ async function request(
err.response.data.code &&
err.response.data.description
) {
console.log(err.response.data);
console.log(err.response.data.description);
return Promise.reject(
new ApiError(err.response.data.code, err.response.data.description)
);
Expand Down
2 changes: 1 addition & 1 deletion app/server/middleware/roleValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = function (roles) {
return async function (req, res, next) {
try {
const data = await fetchUser(req.currentUser.idir_username.toUpperCase());
if (data !== undefined) {
if (data !== undefined && data !== null) {
const logical = user.convertToLogicalModel(data);

if (roles.some((role) => logical.roleId === role)) {
Expand Down

0 comments on commit e8425dc

Please sign in to comment.