habulaj commited on
Commit
420774d
·
verified ·
1 Parent(s): 417d30a

Update routes/users.py

Browse files
Files changed (1) hide show
  1. routes/users.py +5 -1
routes/users.py CHANGED
@@ -13,6 +13,9 @@ SUPABASE_URL = "https://ussxqnifefkgkaumjann.supabase.co"
13
  SUPABASE_KEY = os.getenv("SUPA_KEY")
14
  SUPABASE_ROLE_KEY = os.getenv("SUPA_SERVICE_KEY")
15
 
 
 
 
16
  if not SUPABASE_KEY or not SUPABASE_ROLE_KEY:
17
  raise ValueError("❌ SUPA_KEY ou SUPA_SERVICE_KEY não foram definidos no ambiente!")
18
 
@@ -219,9 +222,10 @@ async def update_user(
219
 
220
  @router.delete("/admin/delete-feed")
221
  async def delete_feed(
222
- feed_id: int = Query(..., description="ID do feed a ser deletado"),
223
  user_token: str = Header(None, alias="User-key")
224
  ):
 
225
  """
226
  Deleta um feed, seus portfolios relacionados e as imagens no bucket.
227
  """
 
13
  SUPABASE_KEY = os.getenv("SUPA_KEY")
14
  SUPABASE_ROLE_KEY = os.getenv("SUPA_SERVICE_KEY")
15
 
16
+ class FeedDeleteRequest(BaseModel):
17
+ feed_id: int
18
+
19
  if not SUPABASE_KEY or not SUPABASE_ROLE_KEY:
20
  raise ValueError("❌ SUPA_KEY ou SUPA_SERVICE_KEY não foram definidos no ambiente!")
21
 
 
222
 
223
  @router.delete("/admin/delete-feed")
224
  async def delete_feed(
225
+ request: FeedDeleteRequest,
226
  user_token: str = Header(None, alias="User-key")
227
  ):
228
+ feed_id = request.feed_id
229
  """
230
  Deleta um feed, seus portfolios relacionados e as imagens no bucket.
231
  """