mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
Update dependencies
This commit is contained in:
@@ -195,7 +195,7 @@ export async function dispatchAddUsedTimeVersion2 ({ deviceId, action, cache, ev
|
||||
startMinuteOfDay: limit.start,
|
||||
endMinuteOfDay: limit.end,
|
||||
// end of primary key
|
||||
lastUsage: action.trustedTimestamp,
|
||||
lastUsage: action.trustedTimestamp.toString(10),
|
||||
lastSessionDuration: item.timeToAdd,
|
||||
roundedLastUpdate: roundedTimestampForSessionDuration
|
||||
}, { transaction: cache.transaction })
|
||||
|
||||
@@ -90,7 +90,7 @@ export async function dispatchMarkTaskPendingAction ({ action, cache, deviceId }
|
||||
|
||||
const childInfo = { name: childInfoUnsafe.name }
|
||||
|
||||
await cache.database.childTask.update({ pendingRequest: true }, {
|
||||
await cache.database.childTask.update({ pendingRequest: 1 }, {
|
||||
where: {
|
||||
familyId: cache.familyId,
|
||||
taskId: action.taskId
|
||||
|
||||
@@ -50,21 +50,21 @@ export async function dispatchAddCategoryApps ({ action, cache, fromChildSelfLim
|
||||
}
|
||||
}
|
||||
|
||||
const categoriesOfSameChild = await cache.database.category.findAll({
|
||||
const categoriesOfSameChild = (await cache.database.category.findAll({
|
||||
where: {
|
||||
familyId: cache.familyId,
|
||||
childId
|
||||
},
|
||||
attributes: ['categoryId', 'parentCategoryId'],
|
||||
transaction: cache.transaction
|
||||
}).map((item) => ({
|
||||
})).map((item) => ({
|
||||
categoryId: item.categoryId,
|
||||
parentCategoryId: item.parentCategoryId
|
||||
}))
|
||||
|
||||
const userCategoryIds = categoriesOfSameChild.map((item) => item.categoryId)
|
||||
|
||||
const oldCategories = await cache.database.categoryApp.findAll({
|
||||
const oldCategories = (await cache.database.categoryApp.findAll({
|
||||
attributes: [ 'categoryId' ],
|
||||
group: [ 'categoryId' ],
|
||||
where: {
|
||||
@@ -77,7 +77,7 @@ export async function dispatchAddCategoryApps ({ action, cache, fromChildSelfLim
|
||||
}
|
||||
},
|
||||
transaction: cache.transaction
|
||||
}).map((item) => item.categoryId)
|
||||
})).map((item) => item.categoryId)
|
||||
|
||||
if (fromChildSelfLimitAddChildUserId !== null) {
|
||||
try {
|
||||
|
||||
@@ -65,7 +65,7 @@ export async function dispatchCreateCategory ({ action, cache, fromChildSelfLimi
|
||||
title: action.title,
|
||||
blockedMinutesInWeek: '',
|
||||
temporarilyBlocked: false,
|
||||
temporarilyBlockedEndTime: 0,
|
||||
temporarilyBlockedEndTime: '0',
|
||||
extraTimeInMillis: 0,
|
||||
extraTimeDay: -1,
|
||||
timeLimitRulesVersion: generateVersionId(),
|
||||
@@ -76,8 +76,10 @@ export async function dispatchCreateCategory ({ action, cache, fromChildSelfLimi
|
||||
blockAllNotifications: false,
|
||||
timeWarningFlags: 0,
|
||||
sort,
|
||||
disableLimitsUntil: 0,
|
||||
taskListVersion: generateVersionId()
|
||||
disableLimitsUntil: '0',
|
||||
taskListVersion: generateVersionId(),
|
||||
minBatteryCharging: 0,
|
||||
minBatteryMobile: 0
|
||||
}, { transaction: cache.transaction })
|
||||
|
||||
// update the cache
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ export async function dispatchUpdateCategoryDisableLimits ({ action, cache, from
|
||||
}
|
||||
|
||||
const [affectedRows] = await cache.database.category.update({
|
||||
disableLimitsUntil: action.endTime
|
||||
disableLimitsUntil: action.endTime.toString(10)
|
||||
}, {
|
||||
where: {
|
||||
familyId: cache.familyId,
|
||||
|
||||
+2
-2
@@ -48,7 +48,7 @@ export async function dispatchUpdateCategoryTemporarilyBlocked ({ action, cache,
|
||||
const categoryEntry = {
|
||||
childId: categoryEntryUnsafe.childId,
|
||||
temporarilyBlocked: categoryEntryUnsafe.temporarilyBlocked,
|
||||
temporarilyBlockedEndTime: categoryEntryUnsafe.temporarilyBlockedEndTime
|
||||
temporarilyBlockedEndTime: parseInt(categoryEntryUnsafe.temporarilyBlockedEndTime, 10)
|
||||
}
|
||||
|
||||
if (fromChildSelfLimitAddChildUserId !== null) {
|
||||
@@ -69,7 +69,7 @@ export async function dispatchUpdateCategoryTemporarilyBlocked ({ action, cache,
|
||||
|
||||
const [affectedRows] = await cache.database.category.update({
|
||||
temporarilyBlocked: action.blocked,
|
||||
temporarilyBlockedEndTime: action.blocked ? (action.endTime ?? 0) : 0
|
||||
temporarilyBlockedEndTime: action.blocked ? (action.endTime ?? 0).toString(10) : '0'
|
||||
}, {
|
||||
where: {
|
||||
familyId: cache.familyId,
|
||||
|
||||
Reference in New Issue
Block a user