This commit is contained in:
@@ -13,23 +13,18 @@ export default {
|
||||
fetch(keys) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
//step 1: build an array of keys that we don't have already
|
||||
var NeedIt = [];
|
||||
var needIt = [];
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
if (!_.has(store.state.localeText, keys[i])) {
|
||||
NeedIt.push(keys[i]);
|
||||
needIt.push(keys[i]);
|
||||
}
|
||||
}
|
||||
if (NeedIt.length == 0) {
|
||||
if (needIt.length == 0) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
//step 2: get it
|
||||
fetch(apiUtil.APIUrl() + "locale/subset", {
|
||||
method: "post",
|
||||
mode: "cors",
|
||||
headers: apiUtil.PostAuthorizedHeaders(),
|
||||
body: JSON.stringify(NeedIt)
|
||||
})
|
||||
fetch(apiUtil.APIUrl("locale/subset"), apiUtil.fetchPost(needIt))
|
||||
.then(apiUtil.status)
|
||||
.then(apiUtil.json)
|
||||
.then(response => {
|
||||
|
||||
Reference in New Issue
Block a user