@@ -2,10 +2,7 @@ import { ListSearchAttributesResponse } from '@temporalio/schemas';
22
33import type { SearchAttributesResponseHumanized } from '$lib/types/workflows' ;
44import { mapEntries } from '$lib/utilities/map-entries' ;
5- import {
6- isTemporalAPIError ,
7- requestFromAPI ,
8- } from '$lib/utilities/request-from-api' ;
5+ import { requestFromAPI } from '$lib/utilities/request-from-api' ;
96import { routeForApi } from '$lib/utilities/route-for-api' ;
107import { toSearchAttributeTypeReadable } from '$lib/utilities/screaming-enums' ;
118
@@ -18,7 +15,7 @@ export const fetchSearchAttributesForNamespace = async (
1815 const parsed = await parsedResponse ( { namespace, request } ) ;
1916
2017 // parse the response to a human readable format
21- return mutateSearchAttributes ( parsed ) ;
18+ return humanizeSearchAttributes ( parsed ) ;
2219 } catch ( err ) {
2320 // handle the error and return a default value
2421 handleError ( { namespace, err } ) ;
@@ -43,7 +40,7 @@ async function parsedResponse({
4340 return ListSearchAttributesResponse . parse ( searchAttributesResponse ) ;
4441}
4542
46- function mutateSearchAttributes (
43+ function humanizeSearchAttributes (
4744 parsed : ListSearchAttributesResponse ,
4845) : SearchAttributesResponseHumanized {
4946 return {
@@ -66,11 +63,7 @@ function handleError({
6663 namespace : string ;
6764 err : unknown ;
6865} ) : SearchAttributesResponseHumanized {
69- let message = 'Error fetching search attributes' ;
70- if ( isTemporalAPIError ( err ) ) {
71- message = 'Error fetching search attributes for namespace:' ;
72- }
73-
66+ const message = 'Error fetching search attributes for namespace:' ;
7467 console . error ( message , namespace , err ) ;
7568
7669 return {
0 commit comments