handleProductVariants :: Handler App App ()
handleProductVariants =
        method GET handleProductOptGet <|>
        method POST handleProductOptPost
    where
        handleProductOptGet = render "admin/_variants"
        handler p
            | "del-variant-id" `M.member` p        = handleDelVariant
            | "del-variant-option-id" `M.member` p = handleDelVariantOption
            | "new-variant" `M.member` p           = handleNewVariant
            | otherwise                            = handleNewVariantOption
        handleProductOptPost = do
            params <- getParams
            handler params
handleProductVariants :: Handler App App ()
handleProductVariants =
        method GET handleProductOptGet <|>
        method POST handleProductOptPost
    where
        handleProductOptGet = render "admin/_variants"
        handler p
            | "del-variant-id" `M.member` p        = handleDelVariant
            | "del-variant-option-id" `M.member` p = handleDelVariantOption
            | "new-variant" `M.member` p           = handleNewVariant
            | otherwise                            = handleNewVariantOption
        handleProductOptPost = do
            params <- getParams
            handler params
handleProductVariants =
        method GET handleProductOptGet <|>
        method POST handleProductOptPost
    where
        handleProductOptGet = render "admin/_variants"
        handler p
            | "del-variant-id" `M.member` p        = handleDelVariant
            | "del-variant-option-id" `M.member` p = handleDelVariantOption
            | "new-variant" `M.member` p           = handleNewVariant
            | otherwise                            = handleNewVariantOption
        handleProductOptPost = do
            params <- getParams
            handler params