From ab1150fd1ea1291c9e46082bd27aed535975d88f Mon Sep 17 00:00:00 2001 From: pius Date: Sun, 12 Jan 2025 15:03:07 +0300 Subject: [PATCH] changed the named argument `personalAccessToken` to a cleaner one `pat` --- packages/dhis2/src/Client.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/dhis2/src/Client.js b/packages/dhis2/src/Client.js index ab21c26de..578341750 100644 --- a/packages/dhis2/src/Client.js +++ b/packages/dhis2/src/Client.js @@ -11,7 +11,7 @@ import Qs from 'qs'; * @param {object} axiosRequest - the axiosRequest contains valid axios params: https://axios-http.com/docs/req_config * @returns {Promise} a promise that will resolve to either a response object or an error object. */ -export function request({ username, password, personalAccessToken }, axiosRequest) { +export function request({ username, password, pat }, axiosRequest) { const { method, url, params } = axiosRequest; console.log(`Sending ${method} request to ${url}`); @@ -26,8 +26,8 @@ export function request({ username, password, personalAccessToken }, axiosReques const headers = { 'Content-Type': 'application/json'} let auth; - if(personalAccessToken){ - headers.Authorization = `ApiToken ${personalAccessToken}` + if(pat){ + headers.Authorization = `ApiToken ${pat}` } else { auth = { username, password } }