Skip to content

Commit

Permalink
fix(core): Updated return type in 'get_obj' function
Browse files Browse the repository at this point in the history
The return type of 'get_obj' function in core/service.py has been updated from StandContent[Union[Model, None]] to StandResponse. This change was made to improve readability and consistency across the application by sticking to one type of return statement.
  • Loading branch information
lihuacai168 committed Nov 14, 2023
1 parent 92b4f42 commit ac864df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def _get_obj_by_id(self, id: int, is_deleted=0) -> Union[Model, None]:
return None
return obj

def get_obj(self, id: int) -> StandResponse[Union[Model, None]]:
def get_obj(self, id: int) -> StandResponse:
return StandResponse(data=self._get_obj_by_id(id=id))

def list_obj(self, page_filter: PageFilter, page_schema: PageSchema) -> PageSchema:
Expand Down

0 comments on commit ac864df

Please sign in to comment.