Skip to content

Commit

Permalink
Ordenação
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasVinicius314 committed Apr 26, 2023
1 parent 34afb8d commit a6a083f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion server/src/routers/event-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ eventRouter.post('/detection/:identifier', async (req, res, next) => {

const sensor = await SensorModel.findOne({
where: { identifier },
order: [['createdAt', 'DESC']],
})

if (sensor === null) {
Expand Down
1 change: 1 addition & 0 deletions server/src/routers/sensor-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ sensorRouter.get('/:sensorId/event', async (req, res, next) => {

const events = await EventModel.findAll({
where: { sensorId },
order: [['createdAt', 'DESC']],
include: {
model: SensorModel,
where: { userId },
Expand Down

0 comments on commit a6a083f

Please sign in to comment.