feat: update marketplace products
This commit is contained in:
@@ -20,6 +20,14 @@ async def update_marketplace(marketplace_id: int):
|
||||
return {'message': f'Stocks for marketplace {marketplace_id} successfully updated'}
|
||||
|
||||
|
||||
async def update_marketplace_products(marketplace_id: int, product_ids: list[int]):
|
||||
async with session_factory() as session:
|
||||
updater = StocksUpdater(session)
|
||||
await updater.update_marketplace_products(marketplace_id, product_ids)
|
||||
return {
|
||||
'message': f'Products [{",".join(list(map(str, product_ids)))}] successfully updated for marketplace {marketplace_id}'}
|
||||
|
||||
|
||||
async def update_marketplaces(marketplace_ids: Union[List[int], None]):
|
||||
async with session_factory() as session:
|
||||
updater = StocksUpdater(session)
|
||||
|
||||
Reference in New Issue
Block a user