async def load_last_snapshot_by_user(current_user: User = Depends( deps.get_current_user)): result = load_last_snapshot(current_user.userId) if result is None: return LastSnapshot() else: return result
async def save_last_snapshot_with_user(last_snapshot: LastSnapshot, current_user: User = Depends( deps.get_current_user)): last_snapshot.userId = current_user.userId save_last_snapshot(last_snapshot) return last_snapshot