forked from cartsnitch/cartsnitch
fix(api): replace UUID type with str for Better-Auth nanoid user IDs
Better-Auth uses nanoid strings for user IDs, not UUIDs. Changed all user_id parameter/return types in the API layer from UUID to str, removed the obsolete UUID import where unused, and updated the _validate_session_token return type accordingly. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -13,7 +13,7 @@ class PurchaseService:
|
||||
|
||||
async def list_purchases(
|
||||
self,
|
||||
user_id: UUID,
|
||||
user_id: str,
|
||||
store_id: UUID | None = None,
|
||||
page: int = 1,
|
||||
page_size: int = 20,
|
||||
@@ -56,7 +56,7 @@ class PurchaseService:
|
||||
for p, item_count, store_name in result.all()
|
||||
]
|
||||
|
||||
async def get_purchase(self, purchase_id: UUID, user_id: UUID) -> dict:
|
||||
async def get_purchase(self, purchase_id: UUID, user_id: str) -> dict:
|
||||
from cartsnitch_api.models import Purchase
|
||||
|
||||
result = await self.db.execute(
|
||||
@@ -88,7 +88,7 @@ class PurchaseService:
|
||||
],
|
||||
}
|
||||
|
||||
async def get_stats(self, user_id: UUID) -> dict:
|
||||
async def get_stats(self, user_id: str) -> dict:
|
||||
from cartsnitch_api.models import Purchase
|
||||
|
||||
result = await self.db.execute(
|
||||
|
||||
Reference in New Issue
Block a user