Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
Merge pull request #306 from CameronRP/add-systemErr-event
Browse files Browse the repository at this point in the history
Add system err event
  • Loading branch information
CameronRP authored Feb 10, 2020
2 parents 9faa131 + 06a865b commit 0719a63
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions api/V1/Schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ async function getSchedule(device: any, response: Response, user = null) {
resData.devices = await models.Device.onlyUsersDevicesMatching(user, {
ScheduleId: device.ScheduleId
});
} else if (user) {
resData.devices = await models.Device.onlyUsersDevicesMatching(user, {
id: device.id
});
}
return responseUtil.send(response, resData);
}
6 changes: 4 additions & 2 deletions models/DetailSnapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface DetailSnapShot
ModelCommon<DetailSnapShot> {
getFile: () => Promise<File>;
id: DetailSnapshotId;
type: "algorithm" | "throttle" | "audioBait";
type: "algorithm" | "throttle" | "audioBait" | "systemError";
details: any; // JSON
}

Expand Down Expand Up @@ -79,7 +79,9 @@ export default function(sequelize, DataTypes): DetailSnapshotStatic {
const existing = await this.findOne({
where: {
type: searchType,
details: searchDetails
details: {
[Op.eq]: searchDetails, // Need to specify the equal operator as it's a JSONB
},
}
});

Expand Down

0 comments on commit 0719a63

Please sign in to comment.