change single char variables to properly named ones
This commit is contained in:
parent
a18ea0831f
commit
c6e01f4334
@ -11,12 +11,12 @@ import useWidgetAPI from "utils/proxy/use-widget-api";
|
||||
function makeFields(Fields = []) {
|
||||
let fields = Fields ?? [];
|
||||
if (fields.length === 0) {
|
||||
fields = ["download", "nondownload", "read", "unread"];
|
||||
fields = ["download", "nonDownload", "read", "unRead"];
|
||||
}
|
||||
if (fields.length > 4) {
|
||||
fields.length = 4;
|
||||
}
|
||||
fields = fields.map((f) => f.toLowerCase());
|
||||
fields = fields.map((field) => field.toLowerCase());
|
||||
|
||||
return fields;
|
||||
}
|
||||
|
||||
@ -97,10 +97,10 @@ const countsToExtract = {
|
||||
function makeBody(fields, category = "all") {
|
||||
if (Number.isNaN(Number(category))) {
|
||||
let query = "";
|
||||
fields.forEach((f) => {
|
||||
fields.forEach((field) => {
|
||||
query += `
|
||||
${f}: chapters(
|
||||
condition: {${countsToExtract[f].gqlCondition}}
|
||||
${field}: chapters(
|
||||
condition: {${countsToExtract[field].gqlCondition}}
|
||||
filter: {inLibrary: {equalTo: true}}
|
||||
) {
|
||||
totalCount
|
||||
@ -179,7 +179,7 @@ function extractCounts(responseJSON, fields) {
|
||||
function makeFields(Fields = []) {
|
||||
let fields = Fields ?? [];
|
||||
if (fields.length === 0) {
|
||||
fields = ["download", "nondownload", "read", "unread"];
|
||||
fields = ["download", "nonDownload", "read", "unRead"];
|
||||
}
|
||||
if (fields.length > 4) {
|
||||
fields.length = 4;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user