PageSourceSearch

https://www.phenomenex.com/scripts/cartQuoteCommonHandler.js

js phenomenex.com collected 2026-10-03 23:17:27 UTC 924 bytes, 33 lines download raw bytes

1import buildErrorToast from './build-error-toast.js';
2// eslint-disable-next-line import/no-cycle
3import { getHostURL } from './scripts.js';
4import { getIdToken } from './auth.js';
5
6export default async function cartQuoteCommonHandler(parts, block, isQuotes = false) {
7  try {
8    const token = await getIdToken();
9
10    const BaseUrl = await getHostURL();
11    const url = `${BaseUrl}/v1.2/Cart/${isQuotes ? 'Detail/ByQuoteID' : 'Details/ByPartID'}`;
12
13    const res = await fetch(url, {
14      method: 'POST',
15      headers: {
16        'Content-Type': 'application/json',
17        ...(token && { Authorization: `Bearer ${token}` }),
18      },
19      body: JSON.stringify(parts),
20    });
21
22    if (!res.ok) {
23      const errText = await res.text();
24      buildErrorToast('Error', errText);
25      throw new Error(errText);
26    }
27
28    return await res.json();
29  } catch (err) {
30    buildErrorToast('Error', err);
31    throw err;
32  }
33}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.