mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
Refactor exception usage
This commit is contained in:
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'SetUserTimezoneAction'
|
||||
|
||||
export class SetUserTimezoneAction extends ParentAction {
|
||||
readonly userId: string
|
||||
@@ -28,7 +30,7 @@ export class SetUserTimezoneAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(userId)
|
||||
assertIdWithinFamily({ actionType, field: 'userId', value: userId })
|
||||
|
||||
this.userId = userId
|
||||
this.timezone = timezone
|
||||
|
||||
Reference in New Issue
Block a user