fix: abstract errors
This commit is contained in:
parent
575917fb5b
commit
94cf102c0b
|
@ -14,15 +14,15 @@ class AbstractDatabaseRepository(ABC):
|
||||||
""""""
|
""""""
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def get_user_by_id(self) -> User:
|
def get_user_by_id(self, user_id: str) -> User:
|
||||||
""""""
|
""""""
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def update_user_by_id(self) -> User:
|
def update_user(self, user: User) -> User:
|
||||||
""""""
|
""""""
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def delete_user(self) -> None:
|
def delete_user(self, user_id: str) -> None:
|
||||||
""""""
|
""""""
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
|
|
|
@ -81,7 +81,7 @@ class SQLiteDatabaseRepository(AbstractDatabaseRepository):
|
||||||
user.username,
|
user.username,
|
||||||
user.avatar_hash,
|
user.avatar_hash,
|
||||||
),
|
),
|
||||||
).fetchall()
|
)
|
||||||
|
|
||||||
except sqlite3.IntegrityError:
|
except sqlite3.IntegrityError:
|
||||||
return UserAlreadyExistError("User already exist!")
|
return UserAlreadyExistError("User already exist!")
|
||||||
|
@ -90,6 +90,9 @@ class SQLiteDatabaseRepository(AbstractDatabaseRepository):
|
||||||
|
|
||||||
return self.get_user_by_id(user_id=user.user_id)
|
return self.get_user_by_id(user_id=user.user_id)
|
||||||
|
|
||||||
|
def update_user(self) -> None:
|
||||||
|
""""""
|
||||||
|
|
||||||
def delete_user(self) -> None:
|
def delete_user(self) -> None:
|
||||||
""""""
|
""""""
|
||||||
|
|
||||||
|
@ -99,5 +102,8 @@ class SQLiteDatabaseRepository(AbstractDatabaseRepository):
|
||||||
def get_matrix_room(self) -> MatrixRoom:
|
def get_matrix_room(self) -> MatrixRoom:
|
||||||
""""""
|
""""""
|
||||||
|
|
||||||
|
def update_matrix_room(self) -> MatrixRoom:
|
||||||
|
""""""
|
||||||
|
|
||||||
def delete_matrix_room(self) -> None:
|
def delete_matrix_room(self) -> None:
|
||||||
""""""
|
""""""
|
||||||
|
|
Reference in a new issue