File tree Expand file tree Collapse file tree 1 file changed +0
-22
lines changed
simple_backend/src/task_tracker Expand file tree Collapse file tree 1 file changed +0
-22
lines changed Original file line number Diff line number Diff line change @@ -33,28 +33,6 @@ def load(self) -> list[dict]:
3333 except json .JSONDecodeError :
3434 return []
3535 # saving task list on gist
36- def save (self , tasks : list [dict ]) -> None :
37- body : dict = {
38- 'files' : {
39- self .filename : {
40- 'content' : json .dumps ({'tasks' : tasks })
41- }
42- }
43- }
44- self ._patch (json_data = body )
45- # loading task list from gist
46- def load (self ) -> list [dict ]:
47- gist_data = self ._get ()
48- files = gist_data .get ("files" , {})
49- if self .filename not in files :
50- return []
51- try :
52- content = files [self .filename ]["content" ]
53- data = json .loads (content )
54- return data .get ("tasks" , [])
55- except json .JSONDecodeError :
56- return []
57- # saving task list on gist
5836 def save (self , tasks : list [dict ]) -> None :
5937 body : dict = {
6038 'files' : {
You can’t perform that action at this time.
0 commit comments