Wocart

@wocart/storefront v3.1.0


@wocart/storefront / index / storefrontApiPath

Function: storefrontApiPath()

storefrontApiPath<N>(name, params?): string

A storefront route's same-origin path, its parameter encoded: storefrontApiPath("communes", { wilayaId: 16 }) → /api/communes/16. Throws when the parameter is missing.

Type Parameters

N

N extends "otpSend" | "otpVerify" | "cartValidate" | "abandonedUpsert" | "abandonedConvert" | "communes" | "reviewsList" | "reviewEligibility" | "reviewUpload" | "reviewSubmit"

Parameters

name

N

params?

StorefrontApiParams<N>

Returns

string