fix: fixed getting shipping warehouses for guests
This commit is contained in:
@@ -6,20 +6,20 @@ from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from backend.dependecies import SessionDependency
|
||||
from backend.session import get_session
|
||||
from schemas.shipping_warehouse import *
|
||||
from services.auth import authorized_user
|
||||
from services.auth import authorized_user, guest_user
|
||||
from services.shipping_warehouse import ShippingWarehouseService
|
||||
|
||||
shipping_warehouse_router = APIRouter(
|
||||
prefix="/shipping-warehouse",
|
||||
tags=["shipping-warehouse"],
|
||||
dependencies=[Depends(authorized_user)]
|
||||
)
|
||||
|
||||
|
||||
@shipping_warehouse_router.get(
|
||||
'/get-all',
|
||||
response_model=GetAllShippingWarehousesResponse,
|
||||
operation_id='get_all_shipping_warehouses'
|
||||
operation_id='get_all_shipping_warehouses',
|
||||
dependencies=[Depends(guest_user)],
|
||||
)
|
||||
async def get_all(
|
||||
session: Annotated[AsyncSession, Depends(get_session)]
|
||||
@@ -30,7 +30,8 @@ async def get_all(
|
||||
@shipping_warehouse_router.post(
|
||||
'/create',
|
||||
response_model=CreateShippingWarehouseResponse,
|
||||
operation_id='create_shipping_warehouse'
|
||||
operation_id='create_shipping_warehouse',
|
||||
dependencies=[Depends(authorized_user)]
|
||||
)
|
||||
async def create(
|
||||
session: SessionDependency,
|
||||
@@ -42,7 +43,8 @@ async def create(
|
||||
@shipping_warehouse_router.post(
|
||||
'/update',
|
||||
response_model=UpdateShippingWarehouseResponse,
|
||||
operation_id='update_shipping_warehouse'
|
||||
operation_id='update_shipping_warehouse',
|
||||
dependencies=[Depends(authorized_user)],
|
||||
)
|
||||
async def update(
|
||||
session: SessionDependency,
|
||||
@@ -55,7 +57,8 @@ async def update(
|
||||
@shipping_warehouse_router.post(
|
||||
'/delete',
|
||||
response_model=DeleteShippingWarehouseResponse,
|
||||
operation_id='delete_shipping_warehouse'
|
||||
operation_id='delete_shipping_warehouse',
|
||||
dependencies=[Depends(authorized_user)],
|
||||
)
|
||||
async def delete(
|
||||
session: SessionDependency,
|
||||
|
||||
Reference in New Issue
Block a user