mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
Fix considering unchanged network time as error
This commit is contained in:
+4
-8
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 Jonas Lochmann
|
* Copyright (C) 2019 - 2020 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -22,7 +22,7 @@ export async function dispatchUpdateNetworkTimeVerification ({ action, cache }:
|
|||||||
action: UpdateNetworkTimeVerificationAction
|
action: UpdateNetworkTimeVerificationAction
|
||||||
cache: Cache
|
cache: Cache
|
||||||
}) {
|
}) {
|
||||||
const [affectedRows] = await cache.database.device.update({
|
await cache.database.device.update({
|
||||||
networkTime: action.mode
|
networkTime: action.mode
|
||||||
}, {
|
}, {
|
||||||
where: {
|
where: {
|
||||||
@@ -32,10 +32,6 @@ export async function dispatchUpdateNetworkTimeVerification ({ action, cache }:
|
|||||||
transaction: cache.transaction
|
transaction: cache.transaction
|
||||||
})
|
})
|
||||||
|
|
||||||
if (affectedRows === 0) {
|
cache.invalidiateDeviceList = true
|
||||||
throw new Error('invalid device id')
|
cache.areChangesImportant = true
|
||||||
} else {
|
|
||||||
cache.invalidiateDeviceList = true
|
|
||||||
cache.areChangesImportant = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user