fix: [CODE-2418] add routing id to labels (#2749)

* fix: [CODE-2418] add routing id to labels
abhinav-harness-patch-1
Ritik Kapoor 2024-09-30 11:21:46 +00:00 committed by Harness
parent a1a4e3fe06
commit 3e7ee33b94
1 changed files with 6 additions and 3 deletions

View File

@ -79,7 +79,7 @@ export const LabelFilter = (props: LabelFilterProps) => {
spaceRef
} = props
const { showError } = useToaster()
const { standalone } = useAppContext()
const { standalone, routingId } = useAppContext()
const [loadingLabels, setLoadingLabels] = useState(false)
const [loadingLabelValues, setLoadingLabelValues] = useState(false)
const [labelValues, setLabelValues] = useState<SelectOption[]>()
@ -101,7 +101,8 @@ export const LabelFilter = (props: LabelFilterProps) => {
page: 1,
limit: LIST_FETCHING_LIMIT,
inherited: true,
query: labelQuery?.trim()
query: labelQuery?.trim(),
accountIdentifier: routingId
}
}
)
@ -135,7 +136,9 @@ export const LabelFilter = (props: LabelFilterProps) => {
: `/spaces/${encodeURIComponent(scopeRef)}/labels/${encodeURIComponent(key)}/values`
try {
const fetchedValues: TypesLabelValue[] = await getUsingFetch(getConfig('code/api/v1'), getPath(), bearerToken, {})
const fetchedValues: TypesLabelValue[] = await getUsingFetch(getConfig('code/api/v1'), getPath(), bearerToken, {
queryParams: { accountIdentifier: routingId }
})
const updatedValuesList = mapToSelectOptions(fetchedValues)
setLoadingLabelValues(false)
return updatedValuesList