Add structured routine logging sheets to Doris Barbell
This commit is contained in:
@@ -267,6 +267,13 @@ class JSONStore:
|
||||
state = self._read()
|
||||
return sorted(state['routines'], key=lambda item: item['name'].lower())
|
||||
|
||||
def get_routine(self, routine_id: str) -> dict[str, Any] | None:
|
||||
state = self._read()
|
||||
for routine in state['routines']:
|
||||
if routine.get('id') == routine_id:
|
||||
return routine
|
||||
return None
|
||||
|
||||
def add_workout(self, payload: dict[str, Any]) -> dict[str, Any]:
|
||||
state = self._read()
|
||||
self._user_or_raise(state, payload['user_id'])
|
||||
|
||||
Reference in New Issue
Block a user