mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-14 16:55:42 +00:00
Remove debug messages and move data inflation into api fn
This commit is contained in:
parent
960f36c740
commit
203faa4257
@ -630,7 +630,11 @@ cqi.api.APIClient = class APIClient {
|
||||
async ext_corpus_static_data(corpus) {
|
||||
const fn_name = 'ext_corpus_static_data';
|
||||
const fn_args = {corpus: corpus};
|
||||
return await this.#request(fn_name, fn_args);
|
||||
let compressedEncodedData = await this.#request(fn_name, fn_args);
|
||||
let encodedData = pako.inflate(compressedEncodedData);
|
||||
let textDecoder = new TextDecoder();
|
||||
let data = textDecoder.decode(encodedData);
|
||||
return JSON.parse(data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -138,15 +138,7 @@ cqi.models.corpora.CorpusCollection = class CorpusCollection extends cqi.models.
|
||||
/************************************************************************
|
||||
* Custom additions for nopaque *
|
||||
************************************************************************/
|
||||
// returnValue.static_data = await this.client.api.ext_corpus_static_data(corpusName);
|
||||
let tmp = await this.client.api.ext_corpus_static_data(corpusName);
|
||||
console.log(tmp);
|
||||
let inflated = pako.inflate(tmp);
|
||||
console.log(inflated);
|
||||
let decoder = new TextDecoder('utf-8');
|
||||
console.log(decoder);
|
||||
let decoded = decoder.decode(inflated);
|
||||
returnValue.static_data = JSON.parse(decoded);
|
||||
returnValue.static_data = await this.client.api.ext_corpus_static_data(corpusName);
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user