From 55bb5100587f44845fdc45c10b74a19ab727b8ee Mon Sep 17 00:00:00 2001 From: Reza Sadeghzadeh Date: Tue, 3 Oct 2023 22:48:48 +0330 Subject: [PATCH] docs(rtk-query): add headers argument to base query example using axios --- docs/rtk-query/usage/customizing-queries.mdx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/rtk-query/usage/customizing-queries.mdx b/docs/rtk-query/usage/customizing-queries.mdx index 31f80fbb5b..47b9cc25e0 100644 --- a/docs/rtk-query/usage/customizing-queries.mdx +++ b/docs/rtk-query/usage/customizing-queries.mdx @@ -369,16 +369,17 @@ const axiosBaseQuery = method: AxiosRequestConfig['method'] data?: AxiosRequestConfig['data'] params?: AxiosRequestConfig['params'] + headers?: AxiosRequestConfig['headers'] }, unknown, unknown > => - async ({ url, method, data, params }) => { + async ({ url, method, data, params, headers }) => { try { - const result = await axios({ url: baseUrl + url, method, data, params }) + const result = await axios({ url: baseUrl + url, method, data, params, headers }) return { data: result.data } } catch (axiosError) { - let err = axiosError as AxiosError + const err = axiosError as AxiosError return { error: { status: err.response?.status,