Skip to content

Commit

Permalink
fix(#31): var namning
Browse files Browse the repository at this point in the history
  • Loading branch information
h1alexbel committed May 23, 2024
1 parent 286d4ca commit e7076a7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,23 +131,23 @@ async function fetchResultsBatch(
// remove this puzzle.
/**
* Range results using dates.
* @param {String} search Search query
* @param {String} completeSearchQuery Search query
* @return {Promise<*>} Ranged results
*/
async function resultsInDateRange(search) {
console.log('Checking if date range should be split: ' + search);
async function resultsInDateRange(completeSearchQuery) {
console.log('Checking if date range should be split: ' + completeSearchQuery);
try {
const GraphQLClient = await api();
const client = new GraphQLClient('https://api.github.com/graphql', {
headers: {
Authorization: `Bearer ${nextToken()}`
}
});
const data = await client.request(countQuery, {completeSearchQuery: search});
const data = await client.request(countQuery, {completeSearchQuery});
console.log(data);
const {count} = data.search;
console.log(`Results: ${count}`);
return count;
const {repositoryCount} = data.search;
console.log(`Results: ${repositoryCount}`);
return repositoryCount;
} catch (error) {
console.error(error);
}
Expand Down Expand Up @@ -236,7 +236,7 @@ function writeFiles(json) {
const data = {
repo: result.nameWithOwner,
branch: result.defaultBranchRef.name,
readme: result.defaultBranchRef.target.repository.object.text,
readme: result.defaultBranchRef.target.repository.object? result.defaultBranchRef.target.repository.object.text : '',
description: result.description ? result.description : '',
topics: result.repositoryTopics.edges.map((edge) => edge.node.topic.name),
createdAt: result.createdAt,
Expand Down

0 comments on commit e7076a7

Please sign in to comment.