Skip to content

Commit

Permalink
Refactor: Use typedef tags inside request utils function to resolve e…
Browse files Browse the repository at this point in the history
…slint errors (anuraghazra#3054)
  • Loading branch information
qwerty541 authored and jacobbexten committed Nov 6, 2024
1 parent a53db3b commit 0f1de97
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,19 @@ const fallbackColor = (color, fallbackColor) => {
);
};

/**
* @typedef {import('axios').AxiosRequestConfig['data']} AxiosRequestConfigData Axios request data.
* @typedef {import('axios').AxiosRequestConfig['headers']} AxiosRequestConfigHeaders Axios request headers.
*/

/**
* Send GraphQL request to GitHub API.
*
* @param {import('axios').AxiosRequestConfig['data']} data Request data.
* @param {import('axios').AxiosRequestConfig['headers']} headers Request headers.
* @param {AxiosRequestConfigData} data Request data.
* @param {AxiosRequestConfigHeaders} headers Request headers.
* @returns {Promise<any>} Request response.
*/
const request = (data, headers) => {
// @ts-ignore
return axios({
url: "https://api.github.com/graphql",
method: "post",
Expand Down

0 comments on commit 0f1de97

Please sign in to comment.