fix(admin-tokens): avoid option none

This commit is contained in:
Gregor Kleen 2021-03-30 11:23:14 +02:00
parent 5c56745042
commit af3ec98de5

View File

@ -39,7 +39,9 @@ data BTFImpersonate
data BTFImpersonate' = BTFINone' | BTFISingle' | BTFIRandom'
deriving (Eq, Ord, Read, Show, Enum, Bounded, Generic, Typeable)
deriving (Universe, Finite, Hashable)
nullaryPathPiece ''BTFImpersonate' $ camelToPathPiece' 1 . dropSuffix "'"
nullaryPathPiece ''BTFImpersonate' $ let noNone n | n == "none" = "impersonate-" <> n
| otherwise = n
in noNone . camelToPathPiece' 1 . dropSuffix "'"
embedRenderMessage ''UniWorX ''BTFImpersonate' $ ("BearerTokenImpersonate" <>) . dropPrefix "BTFI" . dropSuffix "'"
data BearerTokenForm = BearerTokenForm