diff --git a/pssecret/main.py b/pssecret/main.py index 0097e93..0e97ec3 100644 --- a/pssecret/main.py +++ b/pssecret/main.py @@ -24,13 +24,12 @@ async def set_secret(data: Secret): response_model=Secret, responses={404: {"description": "The item was not found"}}, ) -async def get_secret(secret_key): - data = await redis.get(secret_key) +async def get_secret(secret_key: str): + data: str | None = await redis.getdel(secret_key) if data is None: raise HTTPException(404) - await redis.delete(secret_key) return { "data": data, }