Quellcode durchsuchen

:bug: checking for existing sort type before making req

tags/0.9.0
j vor 4 Jahren
Ursprung
Commit
ac24cdda1a
1 geänderte Dateien mit 2 neuen und 1 gelöschten Zeilen
  1. 2
    1
      vue-theme/src/utils/api.js

+ 2
- 1
vue-theme/src/utils/api.js Datei anzeigen

1
 import axios from 'axios'
1
 import axios from 'axios'
2
+import { sortTypes } from './helpers'
2
 
3
 
3
 const SETTINGS = {
4
 const SETTINGS = {
4
     LOADING_SEGMENTS: 2,
5
     LOADING_SEGMENTS: 2,
8
 
9
 
9
 export default {
10
 export default {
10
     getByType(type, sortType, cb) {
11
     getByType(type, sortType, cb) {
11
-        if (sortType) {
12
+        if (sortType && Object.values(sortTypes).includes(sortType)) {
12
             return axios
13
             return axios
13
                 .get(SETTINGS.API_BASE_PATH + `sort/${type}/${sortType}`)
14
                 .get(SETTINGS.API_BASE_PATH + `sort/${type}/${sortType}`)
14
                 .then(response => {
15
                 .then(response => {

Laden…
Abbrechen
Speichern