Skip to content

Commit 6efecd8

Browse files
authored
more updates (#1961)
1 parent 216c061 commit 6efecd8

46 files changed

Lines changed: 613 additions & 1064 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vscode/settings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"typescript.tsdk": "node_modules/typescript/lib"
2+
"typescript.tsdk": "node_modules/typescript/lib",
33
"tailwindCSS.classAttributes": ["className"],
44
"tailwindCSS.classFunctions": ["cx", "cva", "clsx", "classMerge", "twMerge"],
55
"tailwindCSS.lint.cssConflict": "ignore",
@@ -8,5 +8,4 @@
88
"clsx",
99
"tailwind-merge"
1010
]
11-
1211
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* This file should only contain environment variables that are non-secret.
33
*/
4-
const isProduction = process.env.PRODUCTION_DEPLOYMENT === 'true';
4+
export const isProduction = process.env.PRODUCTION_DEPLOYMENT === 'true';
55

66
// These are all exposed by the client, so there's no way to protect them anyways.
77
export const clientTokens = isProduction
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,4 @@ const partners = [
137137
{ name: 'Airbnb', logoSource: airbnb.src, url: 'https://airbnb.com', type: PARTNER_TYPES.KIND },
138138
];
139139

140-
export default sortBy(partners, 'name');
140+
export const partnersSortedByName = sortBy(partners, 'name');

common/constants/successStories.js

Lines changed: 0 additions & 24 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// In seconds
1+
/** In seconds */
22
export const ONE_DAY = 86400;
3+
/** In seconds */
34
export const ONE_WEEK = 604800;
5+
/** In seconds */
46
export const TWO_WEEKS = 1209600;

common/constants/urls.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

common/constants/urls.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export const s3hostName = 'operation-code-assets.s3.us-east-2.amazonaws.com';
2+
export const s3 = `https://${s3hostName}/`;
3+
export const leadershipCircleLink =
4+
'https://secure.lglforms.com/form_engine/s/L428AQ2rrsFJQyy5Fbglvg';
5+
export const codeOfConduct = `https://github.com/OperationCode/operationcode_docs/blob/master/community/code_of_conduct.md`;
6+
export const slackGuidelines = `https://github.com/OperationCode/START_HERE/blob/master/community_guidelines.md`;

common/utils/api-utils.ts

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { AxiosError, AxiosInstance, AxiosRequestConfig } from 'axios';
22
import axios from 'axios';
33
import { networkErrorMessages } from 'common/constants/messages';
44
import { apiUrl, resourcesAPIURL } from 'common/config/environment';
5-
import { setAuthorizationHeader } from 'common/utils/cookie-utils';
65

76
const baseAxiosConfig = {
87
baseURL: apiUrl,
@@ -37,17 +36,13 @@ const getRequestAbortionPieces = () => {
3736

3837
export const get = async (
3938
path: string,
40-
{
41-
token,
42-
parameters,
43-
}: { token?: string; parameters?: Record<string, AxiosRequestConfig['params']> } = {},
39+
{ parameters }: { parameters?: Record<string, AxiosRequestConfig['params']> } = {},
4440
axiosClient = OperationCodeAPI,
4541
) => {
4642
const { abort, connectionTimeout } = getRequestAbortionPieces();
4743

4844
return axiosClient
4945
.get(path, {
50-
headers: setAuthorizationHeader(token),
5146
cancelToken: abort.token,
5247
params: parameters,
5348
})
@@ -61,17 +56,11 @@ export const get = async (
6156
});
6257
};
6358

64-
export const post = async (
65-
path: string,
66-
body: object,
67-
{ token }: { token?: string } = {},
68-
axiosClient: AxiosInstance = axios,
69-
) => {
59+
export const post = async (path: string, body: object, axiosClient: AxiosInstance = axios) => {
7060
const { abort, connectionTimeout } = getRequestAbortionPieces();
7161

7262
return axiosClient
7363
.post(path, body, {
74-
headers: setAuthorizationHeader(token),
7564
cancelToken: abort.token,
7665
})
7766
.then(response => {
@@ -84,17 +73,11 @@ export const post = async (
8473
});
8574
};
8675

87-
export const patch = async (
88-
path: string,
89-
body: object,
90-
{ token }: { token?: string } = {},
91-
axiosClient: AxiosInstance = axios,
92-
) => {
76+
export const patch = async (path: string, body: object, axiosClient: AxiosInstance = axios) => {
9377
const { abort, connectionTimeout } = getRequestAbortionPieces();
9478

9579
return axiosClient
9680
.patch(path, body, {
97-
headers: setAuthorizationHeader(token),
9881
cancelToken: abort.token,
9982
})
10083
.then(response => {
@@ -107,17 +90,11 @@ export const patch = async (
10790
});
10891
};
10992

110-
export const put = async (
111-
path: string,
112-
body: object,
113-
{ token }: { token?: string } = {},
114-
axiosClient: AxiosInstance = axios,
115-
) => {
93+
export const put = async (path: string, body: object, axiosClient: AxiosInstance = axios) => {
11694
const { abort, connectionTimeout } = getRequestAbortionPieces();
11795

11896
return axiosClient
11997
.put(path, body, {
120-
headers: setAuthorizationHeader(token),
12198
cancelToken: abort.token,
12299
})
123100
.then(response => {

common/utils/auth-utils.js

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)