feat(client): remove gitHash from api requests (#51083)
parent
5b641241ad
commit
f91b5841d3
|
@ -10,7 +10,7 @@ import type {
|
|||
User
|
||||
} from '../redux/prop-types';
|
||||
|
||||
const { apiLocation, gitHash } = envData;
|
||||
const { apiLocation } = envData;
|
||||
|
||||
const base = apiLocation;
|
||||
|
||||
|
@ -177,7 +177,7 @@ export function getUserProfile(
|
|||
username: string
|
||||
): Promise<ResponseWithData<UserProfileResponse>> {
|
||||
const responseWithData = get<{ entities?: ApiUser; result?: string }>(
|
||||
`/api/users/get-public-profile?username=${username}&githash=${gitHash}`
|
||||
`/api/users/get-public-profile?username=${username}`
|
||||
);
|
||||
return responseWithData.then(({ response, data }) => {
|
||||
const { result, user } = parseApiResponseToClientUser({
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const path = require('path');
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
const envPath = path.resolve(__dirname, '../.env');
|
||||
const { error } = require('dotenv').config({ path: envPath });
|
||||
|
@ -48,10 +47,6 @@ const locations = {
|
|||
: radioLocation
|
||||
};
|
||||
|
||||
// This is used to identify the current deployment and is trimmed to remove
|
||||
// the trailing newline.
|
||||
const gitHash = execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim();
|
||||
|
||||
module.exports = Object.assign(locations, {
|
||||
clientLocale,
|
||||
curriculumLocale,
|
||||
|
@ -87,6 +82,5 @@ module.exports = Object.assign(locations, {
|
|||
growthbookUri:
|
||||
!growthbookUri || growthbookUri === 'api_URI_from_Growthbook_dashboard'
|
||||
? null
|
||||
: growthbookUri,
|
||||
gitHash
|
||||
: growthbookUri
|
||||
});
|
||||
|
|
|
@ -57,15 +57,13 @@ if (FREECODECAMP_NODE_ENV !== 'development') {
|
|||
const donationKeys = ['stripePublicKey', 'paypalClientId', 'patreonClientId'];
|
||||
const loggingKeys = ['sentryClientDSN'];
|
||||
const abTestingKeys = ['growthbookUri'];
|
||||
const diagnosticKeys = ['gitHash'];
|
||||
|
||||
const expectedVariables = locationKeys.concat(
|
||||
deploymentKeys,
|
||||
searchKeys,
|
||||
donationKeys,
|
||||
loggingKeys,
|
||||
abTestingKeys,
|
||||
diagnosticKeys
|
||||
abTestingKeys
|
||||
);
|
||||
const actualVariables = Object.keys(env as Record<string, unknown>);
|
||||
if (expectedVariables.length !== actualVariables.length) {
|
||||
|
|
Loading…
Reference in New Issue