This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import config from "../utils/config";
|
||||
import api from "./apiutil";
|
||||
import has from "../utils/lodash/map";
|
||||
|
||||
import _ from "../utils/libs/core.min.js";
|
||||
import { getToken } from "../utils/authUtil";
|
||||
/* eslint-disable */
|
||||
/*
|
||||
Locale:
|
||||
Methods
|
||||
@@ -30,24 +31,20 @@ export default {
|
||||
async PreFetch(keys) {
|
||||
//step 1: build an array of keys that we don't have already
|
||||
var NeedIt = [];
|
||||
keys.forEach(key => {
|
||||
if (!has(lt, key)) {
|
||||
NeedIt.push(key);
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
if (!_.has(lt, keys[i])) {
|
||||
NeedIt.push(keys[i]);
|
||||
}
|
||||
});
|
||||
|
||||
//todo: make this work with the locale route to get teh batch of keys and store into the lt object
|
||||
fetch(config.apiUrl + "auth", {
|
||||
}
|
||||
fetch(config.apiUrl + "locale/subset", {
|
||||
method: "post",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
Accept: "application/json, text/plain, */*",
|
||||
"Content-Type": "application/json"
|
||||
"Content-Type": "application/json",
|
||||
Authorization: "Bearer " + getToken()
|
||||
},
|
||||
body: JSON.stringify({
|
||||
login: "",
|
||||
password: ""
|
||||
})
|
||||
body: JSON.stringify(NeedIt)
|
||||
})
|
||||
.then(api.status)
|
||||
.then(api.json)
|
||||
|
||||
Reference in New Issue
Block a user