Fix several problems with gift registry api

This commit is contained in:
2025-03-16 20:23:52 +01:00
parent 54fbed2816
commit 1a18347e93
4 changed files with 33 additions and 18 deletions

View File

@@ -1,4 +1,6 @@
from typing import Any, Dict, Generic, List, Optional, Type, TypeVar, Union
from uuid import UUID
from fastapi.encoders import jsonable_encoder
from pydantic import BaseModel
from sqlalchemy.orm import Session
@@ -19,7 +21,7 @@ class CRUDBase(Generic[ModelType, CreateSchemaType, UpdateSchemaType]):
"""
self.model = model
def get(self, db: Session, id: str) -> Optional[ModelType]:
def get(self, db: Session, id: UUID | str) -> Optional[ModelType]:
return db.query(self.model).filter(self.model.id == id).first()
def get_multi(