Bloc A - Code mort: - Suppression Studio (components, views, features) - Suppression gamification + services mock (projectService, storageService, gamificationService) - Mise à jour Sidebar, Navbar, locales Bloc B - Frontend: - Suppression modal.tsx deprecated, Modal.stories (doublon Dialog) - Feature flags: PLAYLIST_SEARCH, PLAYLIST_RECOMMENDATIONS, ROLE_MANAGEMENT = true - Suppression 19 tests orphelins, retrait exclusions vitest.config Bloc C - Backend: - Extraction routes_auth.go depuis router.go Bloc D - Rust: - Suppression security_legacy.rs (code mort, patterns déjà dans security/)
1 line
1.3 KiB
JavaScript
1 line
1.3 KiB
JavaScript
import{g as s}from"./index-CYK_b1Uz.js";const c={listProducts:async(e,r)=>{const t={...e,page:r?.page||1,limit:r?.limit||12};e?.search&&(t.q=e.search,delete t.search),e?.product_type&&(t.type=e.product_type,delete t.product_type);const a=(await s.get("/marketplace/products",{params:t,_disableRetry:!1})).data||[];return{products:a,total:a.length,page:r?.page||1,limit:r?.limit||12,total_pages:1}},fetchProducts:async(e,r)=>c.listProducts(e,r),createProduct:async e=>(await s.post("/marketplace/products",e)).data,createOrder:async e=>(await s.post("/marketplace/orders",{items:e})).data,purchaseProduct:async e=>c.createOrder([{product_id:e}]),listOrders:async()=>(await s.get("/marketplace/orders")).data,getWishlist:async()=>((await s.get("/marketplace/wishlist")).data?.items??[]).map(t=>t.product?t.product:t.product_id?{id:t.product_id}:null).filter(t=>t!=null),addToWishlist:async e=>{await s.post("/marketplace/wishlist",{product_id:e})},removeFromWishlist:async e=>{await s.delete(`/marketplace/wishlist/${e}`)},getCart:async()=>(await s.get("/commerce/cart")).data?.items??[],addToCart:async(e,r=1)=>{await s.post("/commerce/cart/items",{product_id:e,quantity:r})},removeFromCart:async e=>{await s.delete(`/commerce/cart/items/${e}`)},checkoutCart:async()=>(await s.post("/commerce/cart/checkout")).data};export{c as m};
|