Exemple #1
0
def create_theme(data: SiteTheme,
                 session: Session = Depends(generate_session),
                 current_user=Depends(get_current_user)):
    """ Creates a site color theme database entry """
    db.themes.create(session, data.dict())

    return SnackResponse.success("Theme Saved")
Exemple #2
0
def update_theme(
        id: int,
        data: SiteTheme,
        session: Session = Depends(generate_session),
        current_user=Depends(get_current_user),
):
    """ Update a theme database entry """
    db.themes.update(session, id, data.dict())
Exemple #3
0
def update_theme(
        theme_name: str,
        data: SiteTheme,
        session: Session = Depends(generate_session),
        current_user=Depends(get_current_user),
):
    """ Update a theme database entry """
    db.themes.update(session, theme_name, data.dict())

    return SnackResponse.info(f"Theme Updated: {theme_name}")
Exemple #4
0
def create_theme(data: SiteTheme,
                 session: Session = Depends(generate_session),
                 current_user=Depends(get_current_user)):
    """ Creates a site color theme database entry """
    db.themes.create(session, data.dict())