def create_star(star: schemas.StarCreate, db: Session = Depends(get_db)): # receive json movie without id and return json movie from database with new id return crud.create_star(db=db, star=star)
def create_star(star: schemas.StarCreate, db: Session = Depends(get_db)): return crud.create_star(db=db, star=star)
def make_movie(star: schemas.MovieCreate, db: Session = Depends(get_db)): return crud.create_star(db=db, star=star)
def create_star(star: schemas.StarCreate, db: Session = Depends(get_db)): db_star = crud.get_stars_by_name(db, name=star.name) if db_star: raise HTTPException(status_code=400, detail="Star %s already in db." % name) return crud.create_star(db=db, star=star)