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 = []) {
|
function makeFields(Fields = []) {
|
||||||
let fields = Fields ?? [];
|
let fields = Fields ?? [];
|
||||||
if (fields.length === 0) {
|
if (fields.length === 0) {
|
||||||
fields = ["download", "nondownload", "read", "unread"];
|
fields = ["download", "nonDownload", "read", "unRead"];
|
||||||
}
|
}
|
||||||
if (fields.length > 4) {
|
if (fields.length > 4) {
|
||||||
fields.length = 4;
|
fields.length = 4;
|
||||||
}
|
}
|
||||||
fields = fields.map((f) => f.toLowerCase());
|
fields = fields.map((field) => field.toLowerCase());
|
||||||
|
|
||||||
return fields;
|
return fields;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -97,10 +97,10 @@ const countsToExtract = {
|
|||||||
function makeBody(fields, category = "all") {
|
function makeBody(fields, category = "all") {
|
||||||
if (Number.isNaN(Number(category))) {
|
if (Number.isNaN(Number(category))) {
|
||||||
let query = "";
|
let query = "";
|
||||||
fields.forEach((f) => {
|
fields.forEach((field) => {
|
||||||
query += `
|
query += `
|
||||||
${f}: chapters(
|
${field}: chapters(
|
||||||
condition: {${countsToExtract[f].gqlCondition}}
|
condition: {${countsToExtract[field].gqlCondition}}
|
||||||
filter: {inLibrary: {equalTo: true}}
|
filter: {inLibrary: {equalTo: true}}
|
||||||
) {
|
) {
|
||||||
totalCount
|
totalCount
|
||||||
@ -179,7 +179,7 @@ function extractCounts(responseJSON, fields) {
|
|||||||
function makeFields(Fields = []) {
|
function makeFields(Fields = []) {
|
||||||
let fields = Fields ?? [];
|
let fields = Fields ?? [];
|
||||||
if (fields.length === 0) {
|
if (fields.length === 0) {
|
||||||
fields = ["download", "nondownload", "read", "unread"];
|
fields = ["download", "nonDownload", "read", "unRead"];
|
||||||
}
|
}
|
||||||
if (fields.length > 4) {
|
if (fields.length > 4) {
|
||||||
fields.length = 4;
|
fields.length = 4;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user