mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
Add support for temporarily blocking with end time
This commit is contained in:
@@ -45,6 +45,7 @@ export async function dispatchCreateCategory ({ action, cache }: {
|
||||
title: action.title,
|
||||
blockedMinutesInWeek: '',
|
||||
temporarilyBlocked: false,
|
||||
temporarilyBlockedEndTime: 0,
|
||||
extraTimeInMillis: 0,
|
||||
timeLimitRulesVersion: generateVersionId(),
|
||||
baseVersion: generateVersionId(),
|
||||
|
||||
+3
-2
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
@@ -29,7 +29,8 @@ export async function dispatchUpdateCategoryTemporarilyBlocked ({ action, cache
|
||||
}
|
||||
|
||||
const [affectedRows] = await cache.database.category.update({
|
||||
temporarilyBlocked: action.blocked
|
||||
temporarilyBlocked: action.blocked,
|
||||
temporarilyBlockedEndTime: action.blocked ? (action.endTime ?? 0) : 0
|
||||
}, {
|
||||
where: {
|
||||
familyId: cache.familyId,
|
||||
|
||||
Reference in New Issue
Block a user