
from V2.functions.Etsy.Products import updateSingleEtsyProduct
from V2.functions.Shops.main import Shop
from V2.middlewares.auth import API_Error
from V2.Params import Params


def updateSingleProduct(params:Params):
    platformProductId = params.args.get('platformProductId')
    shop = Shop.get(params.args.get("shopId"))
    if not shop:  raise API_Error("Shop not found.", 404)
    if shop.platformId == "1": return updateSingleEtsyProduct(shop, platformProductId)
    raise API_Error("Not implemented", 404)
