Ver código fonte

:bug: checking for existing sort type before making req

tags/0.9.0
j 4 anos atrás
pai
commit
ac24cdda1a
1 arquivos alterados com 2 adições e 1 exclusões
  1. 2
    1
      vue-theme/src/utils/api.js

+ 2
- 1
vue-theme/src/utils/api.js Ver arquivo

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

Carregando…
Cancelar
Salvar