Feat: add put and delete path to api
This commit is contained in:
@@ -72,11 +72,11 @@ class TribeSQLiteRepository(AbstractRepository):
|
||||
rows = cursor.fetchall()
|
||||
return [Tribe(*r) for r in rows]
|
||||
|
||||
def delete(self, tribe: Tribe) -> None:
|
||||
def delete(self, name: str) -> None:
|
||||
tribes = self.list()
|
||||
if tribe.name not in map(lambda x: x.name, tribes):
|
||||
if name not in map(lambda x: x.name, tribes):
|
||||
raise TribeRepositoryError(
|
||||
f"The tribe {tribe.name} doesn't exists. Can't delete it."
|
||||
f"The tribe {name} doesn't exists. Can't delete it."
|
||||
)
|
||||
|
||||
self.conn.execute(
|
||||
@@ -84,6 +84,6 @@ class TribeSQLiteRepository(AbstractRepository):
|
||||
DELETE FROM tribes WHERE name=:name
|
||||
""",
|
||||
{
|
||||
"name": tribe.name,
|
||||
"name": name,
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user