def repo_like(repo_name: str, uid: int): repo = Repo.get_one_by_full_name(repo_name) if not repo: return None db.session.merge(UserAttitude.like(uid, repo.id)) db.session.commit() return repo.id