Skip to content

Commit

Permalink
Merge pull request #93 from metrico/joel-feature-tables
Browse files Browse the repository at this point in the history
fix: labels endpoint definition
  • Loading branch information
jacovinus authored May 31, 2022
2 parents 3124d0d + b193387 commit 2c80391
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/actions/errorHandler.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const errorHandler = (error) => {

const LABELS_URL = "/loki/api/v1/labels";
const LABELS_URL = "/loki/api/v1/label";
const QUERY_URL = "/loki/api/v1/query_range";

const { request, response } = error;
Expand All @@ -10,10 +10,10 @@ export const errorHandler = (error) => {
let type = () => {
switch(url) {
case url?.includes(LABELS_URL):
return 'labels';
return 'label';
case url?.includes(QUERY_URL):
return 'query'
default: return 'labels'
default: return 'label'
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/actions/loadLabels.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function loadLabels(apiUrl) {

return function (dispatch) {
axios
.get(`${url.trim()}/loki/api/v1/labels`, options)
.get(`${url.trim()}/loki/api/v1/label`, options)
?.then((response) => {
if (response) {
if (response?.data?.data?.length > 0) {
Expand Down

0 comments on commit 2c80391

Please sign in to comment.