export type DeleteApiV2UserCatalogsStoreIdCustomColumnsColumnIdArgs = {storeId: unknown, columnId: unknown}; export type DeleteApiV2UserCatalogsStoreIdCustomColumnsColumnIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete custom column * * DELETE /v2/user/catalogs/{storeId}/customColumns/{columnId} */ export const deleteApiV2UserCatalogsStoreIdCustomColumnsColumnId = async (args: DeleteApiV2UserCatalogsStoreIdCustomColumnsColumnIdArgs, options?: DeleteApiV2UserCatalogsStoreIdCustomColumnsColumnIdOptions) => { const {baseUrl = "https://api.beezup.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v2/user/catalogs/${encodeURIComponent(String(args.storeId))}/customColumns/${encodeURIComponent(String(args.columnId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };