Skip to content

Commit 52a4359

Browse files
authored
fix: TT-384 Add the file name as a parameter of the function
1 parent 36cd17d commit 52a4359

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

time_tracker_api/activities/activities_model.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,20 @@ def find_all(
113113
function_mapper = self.get_mapper_or_dict(mapper)
114114
return list(map(function_mapper, result))
115115

116-
def find_all_from_blob_storage(self, event_context: EventContext, mapper: Callable = None):
116+
def find_all_from_blob_storage(
117+
self,
118+
event_context: EventContext,
119+
mapper: Callable = None,
120+
file_name: str = "activity.json",
121+
):
117122
tenant_id_value = self.find_partition_key_value(event_context)
118123
function_mapper = self.get_mapper_or_dict(mapper)
119124
if tenant_id_value is None:
120125
return []
121126

122127
import json
123128
fs = FileStream("storageaccounteystr82c5","tt-common-files")
124-
result = fs.get_file_stream("activity.json")
129+
result = fs.get_file_stream(file_name)
125130
return list(map(function_mapper, json.load(result))) if result is not None else []
126131

127132
class ActivityCosmosDBDao(APICosmosDBDao, ActivityDao):

0 commit comments

Comments
 (0)