Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Repo card: Use typedef tags inside data fetcher to resolve eslint errors #3043

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/fetchers/repo-fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
import { retryer } from "../common/retryer.js";
import { MissingParamError, request } from "../common/utils.js";

/**
* @typedef {import('axios').AxiosRequestHeaders} AxiosRequestHeaders Axios request headers.
* @typedef {import('axios').AxiosResponse} AxiosResponse Axios response.
*/

/**
* Repo data fetcher.
*
* @param {import('axios').AxiosRequestHeaders} variables Fetcher variables.
* @param {AxiosRequestHeaders} variables Fetcher variables.
* @param {string} token GitHub token.
* @returns {Promise<import('axios').AxiosResponse>} The response.
* @returns {Promise<AxiosResponse>} The response.
*/
const fetcher = (variables, token) => {
return request(
Expand Down Expand Up @@ -53,12 +58,16 @@ const fetcher = (variables, token) => {

const urlExample = "/api/pin?username=USERNAME&amp;repo=REPO_NAME";

/**
* @typedef {import("./types").RepositoryData} RepositoryData Repository data.
*/

/**
* Fetch repository data.
*
* @param {string} username GitHub username.
* @param {string} reponame GitHub repository name.
* @returns {Promise<import("./types").RepositoryData>} Repository data.
* @returns {Promise<RepositoryData>} Repository data.
*/
const fetchRepo = async (username, reponame) => {
if (!username && !reponame) {
Expand Down
Loading