export function fetchWhiteboardTag()

in lib/bzapi.js [113:141]


export function fetchWhiteboardTag(whiteboardTag) {
  const apiParams = {
    ...whiteboardTagParams,
    ...webExtOnlyParams,
    ...openBugParams,
    status_whiteboard: whiteboardTag,
    count_only: true,
  };

  const webParams = { ...apiParams };
  delete webParams.count_only;

  const apiURL = `${baseAPIURL}?${queryString.stringify(apiParams)}`;
  const webURL = `${baseWEBURL}?${queryString.stringify(webParams)}`;

  return serverSWR(
    apiURL,
    async () => {
      const result = await fetch(apiURL, {
        headers: { 'Content-Type': 'application/json' },
      });
      const json = await result.json();
      return { count: json.bug_count, url: webURL };
    },
    {
      hashKey: true,
    },
  );
}