Update dependencies

This commit is contained in:
Jonas Lochmann
2020-12-28 01:00:00 +01:00
parent 2bb3777484
commit eca9473e11
133 changed files with 2298 additions and 2495 deletions
@@ -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
@@ -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,
@@ -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,