mirror of
https://github.com/unraid/api.git
synced 2026-01-12 19:50:07 -06:00
fix: ensure regTy is always uppercase
This commit is contained in:
@@ -261,7 +261,7 @@ const parse = (state: VarIni): Var => {
|
||||
portssl: toNumber(state.portssl),
|
||||
porttelnet: toNumber(state.porttelnet),
|
||||
regCheck: state.regCheck === '' ? 'Valid' : 'Error',
|
||||
regTy: ['Basic', 'Plus', 'Pro'].includes(state.regTy) ? state.regTy : 'Invalid',
|
||||
regTy: (['Basic', 'Plus', 'Pro'].includes(state.regTy) ? state.regTy : 'Invalid').toUpperCase(),
|
||||
// Make sure to use a || not a ?? as regCheck can be an empty string
|
||||
regState: (state.regCheck || state.regTy).toUpperCase(),
|
||||
safeMode: iniBooleanToJsBoolean(state.safeMode),
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// @todo: remove string and add rest of the options
|
||||
type FsType = 'xfs' | string;
|
||||
type RegistrationCheck = 'Error' | 'Valid';
|
||||
type RegistrationType = 'Invalid' | 'Basic' | 'Plus' | 'Pro' | string;
|
||||
type RegistrationType = 'INVALID' | 'BASIC' | 'PLUS' | 'PRO' | string;
|
||||
|
||||
/**
|
||||
* Global vars
|
||||
|
||||
@@ -176,13 +176,13 @@ enum mdState {
|
||||
|
||||
enum registrationType {
|
||||
"""Basic"""
|
||||
Basic
|
||||
BASIC
|
||||
"""Plus"""
|
||||
Plus
|
||||
PLUS
|
||||
"""Pro"""
|
||||
Pro
|
||||
"""Invalid"""
|
||||
Invalid
|
||||
PRO
|
||||
"""nvalid"""
|
||||
INVALID
|
||||
}
|
||||
|
||||
enum registrationState {
|
||||
|
||||
Reference in New Issue
Block a user