From 7809b32402a9ea0a9d904a68f0c74030fc3a4d82 Mon Sep 17 00:00:00 2001 From: DanielTQuach Date: Mon, 9 Jun 2025 00:44:02 -0700 Subject: [PATCH 01/12] 2DPrinting remove axios --- src/APIFunctions/2DPrinting.js | 74 +++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 32 deletions(-) diff --git a/src/APIFunctions/2DPrinting.js b/src/APIFunctions/2DPrinting.js index 6fdf07d03..de570e43d 100644 --- a/src/APIFunctions/2DPrinting.js +++ b/src/APIFunctions/2DPrinting.js @@ -1,4 +1,3 @@ -import axios from 'axios'; import { PrintApiResponse, ApiResponse @@ -22,14 +21,17 @@ export const range = (start, end) => { export async function healthCheck() { let status = new ApiResponse(); const url = new URL('/api/Printer/healthCheck', BASE_API_URL); - await axios.get(url.href) - .then(res => { - status.responseData = res.data; - }) - .catch(err => { - status.responseData = err; + try { + const res = await fetch(url.href); + if (res.ok) { + status.responseData = await res.json(); + } else { status.error = true; - }); + } + } catch (err) { + status.responseData = err; + status.error = true; + } return status; } @@ -78,18 +80,22 @@ export function parseRange(pages, maxPages) { export async function printPage(data, token) { let status = new ApiResponse(); const url = new URL('/api/Printer/sendPrintRequest', BASE_API_URL); - await axios.post(url.href, data, { - headers: { - 'Content-Type': 'multipart/form-data', - 'Authorization': `Bearer ${token}` - } - }) - .then(response => { - status.responseData = response.data.message; - }) - .catch(() => { - status.error = true; + try { + const res = await fetch(url.href, { + method: 'POST', + headers: { + 'Authorization': `Bearer ${token}` + }, + body: data }); + if (res.ok) { + const response = await res.json(); + status.responseData = response.message; + } + } catch (err) { + status.responseData = err; + status.error = true; + } return status; } @@ -105,20 +111,24 @@ export async function printPage(data, token) { export async function getPagesPrinted(email, token) { let status = new PrintApiResponse(); const url = new URL('/api/user/getPagesPrintedCount', BASE_API_URL); - await axios - .post(url.href, { - email - }, { + try { + const res = await fetch(url.href, { + method: 'POST', headers: { - 'Authorization': `Bearer ${token}` - } - } - ) - .then(res => { - status.pagesUsed = res.data; - }) - .catch(() => { - status.error = true; + 'Authorization': `Bearer ${token}`, + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ email }) }); + if (res.ok) { + const response = await res.json(); + status.pagesUsed = response.pagesUsed; + } else { + status.error = true; + } + } catch (err) { + status.responseData = err; + status.error = true; + } return status; } From f852a3efa5a01d52ab9c92201d136bbccfca9933 Mon Sep 17 00:00:00 2001 From: DanielTQuach Date: Mon, 9 Jun 2025 00:57:20 -0700 Subject: [PATCH 02/12] Advertisements remove axios --- src/APIFunctions/Advertisement.js | 104 ++++++++++++++++++------------ 1 file changed, 64 insertions(+), 40 deletions(-) diff --git a/src/APIFunctions/Advertisement.js b/src/APIFunctions/Advertisement.js index 871accdd4..80d919032 100644 --- a/src/APIFunctions/Advertisement.js +++ b/src/APIFunctions/Advertisement.js @@ -1,70 +1,94 @@ -import axios from 'axios'; import { ApiResponse } from './ApiResponses'; import { BASE_API_URL } from '../Enums'; export async function getAd() { let status = new ApiResponse(); - await axios.get(BASE_API_URL + '/api/Advertisement/') - .then(res => { - status.responseData = res.data; - }).catch(err => { - status.responseData = err; + try { + const res = await fetch (BASE_API_URL + '/api/Advertisement/') + if (res.ok) { + status.responseData = await res.json(); + } else { status.error = true; - }); + } + + } catch (err) { + status.responseData = err; + status.error = true; + } return status; } export async function getAds(token) { let status = new ApiResponse(); - await axios.get(BASE_API_URL + '/api/Advertisement/getAllAdvertisements', - { - headers: { - Authorization: `Bearer ${token}` + try { + const res = await fetch(BASE_API_URL + '/api/Advertisement/getAllAdvertisements', + { + method: 'GET', + headers: { + Authorization: `Bearer ${token}` + } } - } - ) - .then(res => { - status.responseData = res.data; - }).catch(err => { - status.responseData = err; + ); + if (res.ok) { + status.responseData = await res.json(); + } else { status.error = true; - }); + } + } catch (err) { + status.responseData = err; + status.error = true; + } return status; } export async function createAd(newAd, token) { let status = new ApiResponse(); - await axios.post(BASE_API_URL + '/api/Advertisement/createAdvertisement', - newAd, - { - headers: { - Authorization: `Bearer ${token}` + try { + const res = await fetch(BASE_API_URL + '/api/Advertisement/createAdvertisement', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}` + }, + body: JSON.stringify(newAd) } - }) - .then(res => { - status.responseData = res.data; - }).catch(err => { - status.responseData = err; + ); + if (res.ok) { + status.responseData = await res.json(); + } else { status.error = true; - }); + } + + } catch (err) { + status.responseData = err; + status.error = true; + } return status; } export async function deleteAd(newAd, token) { let status = new ApiResponse(); - await axios.post(BASE_API_URL + '/api/Advertisement/deleteAdvertisement', - newAd, - { - headers: { - Authorization: `Bearer ${token}` + try { + const res = await fetch(BASE_API_URL + '/api/Advertisement/deleteAdvertisement', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}` + }, + body: JSON.stringify(newAd) } - }) - .then(res => { - status.responseData = res.data; - }).catch(err => { - status.responseData = err; + ); + if (res.ok) { + status.responseData = await res.json(); + } else { status.error = true; - }); + } + } catch (err) { + status.responseData = err; + status.error = true; + } return status; } From 5fea1df2d9b01c41af35b1b282ccfc0e376e72ce Mon Sep 17 00:00:00 2001 From: DanielTQuach Date: Mon, 9 Jun 2025 01:11:28 -0700 Subject: [PATCH 03/12] Auth remove axios --- src/APIFunctions/Auth.js | 165 +++++++++++++++++++++++++-------------- 1 file changed, 106 insertions(+), 59 deletions(-) diff --git a/src/APIFunctions/Auth.js b/src/APIFunctions/Auth.js index 99e723ba5..5a1a01a90 100644 --- a/src/APIFunctions/Auth.js +++ b/src/APIFunctions/Auth.js @@ -1,4 +1,3 @@ -import axios from 'axios'; import { UserApiResponse, ApiResponse } from './ApiResponses'; import { updateLastLoginDate } from './User'; import { BASE_API_URL } from '../Enums'; @@ -30,23 +29,32 @@ export async function registerUser(userToRegister) { captchaToken } = userToRegister; const url = new URL('/api/Auth/register', BASE_API_URL); - await axios - .post(url.href, { - firstName, - lastName, - email, - password, - major, - numberOfSemestersToSignUpFor, - captchaToken - }) - .then(res => { - status.responseData = res.data; - }) - .catch(err => { - status.error = true; - status.responseData = err.response; + try { + const res = await fetch(url.href, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + firstName, + lastName, + email, + password, + major, + numberOfSemestersToSignUpFor, + captchaToken + }) }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch (err) { + status.error = true; + status.responseData = err.response; + } return status; } @@ -60,17 +68,26 @@ export async function registerUser(userToRegister) { export async function loginUser(email, password) { let status = new UserApiResponse(); const url = new URL('/api/Auth/login', BASE_API_URL); - await axios - .post(url.href, { email, password }) - .then(async result => { - status.token = result.data.token; - await updateLastLoginDate(email, result.data.token); + try { + const res = await fetch(url.href, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ email, password }) + }); + if (res.ok) { + const result = await res.json(); + status.token = result.token; + await updateLastLoginDate(email, result.token); window.location.reload(); - }) - .catch(error => { + } else { status.error = true; - status.responseData = error.response; - }); + } + } catch (err) { + status.error = true; + status.responseData = err.response; + } return status; } @@ -94,20 +111,23 @@ export async function checkIfUserIsSignedIn() { } const url = new URL('/api/Auth/verify', BASE_API_URL); - await axios - .post(url.href, {}, { + try { + const res = await fetch(url.href, { + method: 'POST', headers: { + 'Content-Type': 'application/json', Authorization: `Bearer ${token}` } - }) - .then(res => { - status.responseData = res.data; - status.token = token; - }) - .catch(err => { - status.error = true; - status.responseData = err; }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + status.token = token; + } + } catch (err) { + status.error = true; + status.responseData = err; + } return status; } @@ -121,15 +141,24 @@ export async function checkIfUserIsSignedIn() { export async function validateVerificationEmail(email, hashedId) { let status = new ApiResponse(); const url = new URL('/api/Auth/validateVerificationEmail', BASE_API_URL); - await axios - .post(url.href, { - email, - hashedId - }) - .catch(err => { - status.responseData = err; - status.error = true; + try { + const res = await fetch(url.href, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ email, hashedId }) }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch (err) { + status.error = true; + status.responseData = err.response; + } return status; } @@ -143,27 +172,45 @@ export async function validateVerificationEmail(email, hashedId) { export async function resetPassword(password, hashedId, resetToken) { let status = new ApiResponse(); const url = new URL('/api/Auth/resetPassword', BASE_API_URL); - await axios - .post(url.href, { - password, - hashedId, - resetToken - }) - .catch(err => { - status.error = err; - status.responseData = err.response; + try { + const res = await fetch(url.href, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ password, hashedId, resetToken }) }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch (err) { + status.error = true; + status.responseData = err.response; + } return status; } export async function validatePasswordReset(resetToken) { let status = new ApiResponse(); const url = new URL('/api/Auth/validatePasswordReset', BASE_API_URL); - await axios - .post(url.href, { resetToken }) - .catch(err => { - status.error = true; - status.responseData = err.response; - }); + try { + const res = await fetch(url.href, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ resetToken }) + }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } + } catch (err) { + status.error = true; + status.responseData = err.response; + } return status; } From c9dc73181f77b38514206eabf6318276a717a1a2 Mon Sep 17 00:00:00 2001 From: DanielTQuach Date: Mon, 9 Jun 2025 01:13:06 -0700 Subject: [PATCH 04/12] advertisement consistency fix --- src/APIFunctions/Advertisement.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/APIFunctions/Advertisement.js b/src/APIFunctions/Advertisement.js index 80d919032..55448d66f 100644 --- a/src/APIFunctions/Advertisement.js +++ b/src/APIFunctions/Advertisement.js @@ -7,11 +7,11 @@ export async function getAd() { try { const res = await fetch (BASE_API_URL + '/api/Advertisement/') if (res.ok) { - status.responseData = await res.json(); + const result = await res.json(); + status.responseData = result; } else { status.error = true; } - } catch (err) { status.responseData = err; status.error = true; @@ -56,7 +56,8 @@ export async function createAd(newAd, token) { } ); if (res.ok) { - status.responseData = await res.json(); + const result = await res.json(); + status.responseData = result; } else { status.error = true; } @@ -82,7 +83,8 @@ export async function deleteAd(newAd, token) { } ); if (res.ok) { - status.responseData = await res.json(); + const result = await res.json(); + status.responseData = res; } else { status.error = true; } From f51c97ea1f6bb828cc8786d97484c705c0dc44ad Mon Sep 17 00:00:00 2001 From: DanielTQuach Date: Mon, 9 Jun 2025 01:20:34 -0700 Subject: [PATCH 05/12] Cleezy remove axios --- src/APIFunctions/Cleezy.js | 91 ++++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 43 deletions(-) diff --git a/src/APIFunctions/Cleezy.js b/src/APIFunctions/Cleezy.js index 96c88a6ce..489e21cee 100644 --- a/src/APIFunctions/Cleezy.js +++ b/src/APIFunctions/Cleezy.js @@ -1,4 +1,3 @@ -import axios from 'axios'; import { ApiResponse } from './ApiResponses'; import { BASE_API_URL } from '../Enums'; @@ -9,45 +8,52 @@ export async function getAllUrls({ }) { let status = new ApiResponse(); const url = new URL('/api/Cleezy/list', BASE_API_URL); - await axios - .get( - url.href, { - params: { - page, - ...(search !== undefined && { search }), - sortColumn, - sortOrder - }, headers: { - 'Authorization': `Bearer ${token}` - } + try { + const res = await fetch(url.href, { + method: 'GET', + headers: { + 'Authorization': `Bearer ${token}`, + 'Content-Type': 'application/json' }, - ) - .then(res => { - status.responseData = res.data; - }) - .catch(err => { - status.responseData = err; - status.error = true; + params: { + page, + ...(search !== undefined && { search }), + sortColumn, + sortOrder + } }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch (err) { + status.error = true; + status.responseData = err; + } return status; } export async function createUrl(url, alias = null, token) { let status = new ApiResponse(); const urlToAdd = { url, alias }; + const url = new URL('/api/Cleezy/createUrl', BASE_API_URL); try { - const url = new URL('/api/Cleezy/createUrl', BASE_API_URL); - const response = await axios - .post( - url.href, - urlToAdd, - { - headers: { - 'Authorization': `Bearer ${token}` - } - }); - const data = response.data; - status.responseData = data; + const res = await fetch(url.href, { + method: 'POST', + headers: { + 'Authorization': `Bearer ${token}`, + 'Content-Type': 'application/json' + }, + body: JSON.stringify(urlToAdd) + }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } } catch (err) { status.error = true; status.responseData = err; @@ -59,18 +65,17 @@ export async function deleteUrl(aliasIn, token) { let status = new ApiResponse(); const alias = { 'alias': aliasIn }; const url = new URL('/api/Cleezy/deleteUrl', BASE_API_URL); - await axios - .post( - url.href, - alias, - { - headers: { - 'Authorization': `Bearer ${token}` - } - }) - .catch(err => { - status.responseData = err; - status.error = true; + try { + const res = await fetch(url.href, { + method: 'DELETE', + headers: { + 'Authorization': `Bearer ${token}`, + 'Content-Type': 'application/json' + }, }); + } catch (err) { + status.error = true; + status.responseData = err; + } return status; } From 2d61904f69c2197f2f3a65c4e5a18a78ae569318 Mon Sep 17 00:00:00 2001 From: DanielTQuach Date: Mon, 9 Jun 2025 01:25:41 -0700 Subject: [PATCH 06/12] LedSign remove axios --- src/APIFunctions/LedSign.js | 58 ++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/src/APIFunctions/LedSign.js b/src/APIFunctions/LedSign.js index 48c2de865..b5a58ad80 100644 --- a/src/APIFunctions/LedSign.js +++ b/src/APIFunctions/LedSign.js @@ -1,4 +1,3 @@ -import axios from 'axios'; import { ApiResponse } from './ApiResponses'; import { BASE_API_URL } from '../Enums'; @@ -12,15 +11,24 @@ import { BASE_API_URL } from '../Enums'; export async function healthCheck(officerName) { let status = new ApiResponse(); const url = new URL('/api/LedSign/healthCheck', BASE_API_URL); - await axios - .get(url.href, { officerName }) - .then(res => { - status.responseData = res.data; - }) - .catch(err => { - status.responseData = err; - status.error = true; + try { + const res = await fetch(url.href, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + 'Officer-Name': officerName + } }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch(err) { + status.responseData = err; + status.error = true; + } return status; } @@ -34,22 +42,24 @@ export async function healthCheck(officerName) { export async function updateSignText(signData, token) { let status = new ApiResponse(); const url = new URL('/api/LedSign/updateSignText', BASE_API_URL); - await axios - .post( - url.href, - signData, - { - headers: { - Authorization: `Bearer ${token}` - } + try { + const res = await fetch(url.href, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'Authorization': `Bearer ${token}` }, - ) - .then(res => { - status.responseData = res.data; - }) - .catch(err => { - status.responseData = err; - status.error = true; + body: JSON.stringify(signData) }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch(err) { + status.responseData = err; + status.error = true; + } return status; } From b8de167e1b94b7a295821144abd31e2e95279edf Mon Sep 17 00:00:00 2001 From: DanielTQuach Date: Mon, 9 Jun 2025 01:28:21 -0700 Subject: [PATCH 07/12] catch spacing fix --- src/APIFunctions/2DPrinting.js | 6 +++--- src/APIFunctions/Advertisement.js | 8 ++++---- src/APIFunctions/Auth.js | 12 ++++++------ src/APIFunctions/Cleezy.js | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/APIFunctions/2DPrinting.js b/src/APIFunctions/2DPrinting.js index de570e43d..f539510e4 100644 --- a/src/APIFunctions/2DPrinting.js +++ b/src/APIFunctions/2DPrinting.js @@ -28,7 +28,7 @@ export async function healthCheck() { } else { status.error = true; } - } catch (err) { + } catch(err) { status.responseData = err; status.error = true; } @@ -92,7 +92,7 @@ export async function printPage(data, token) { const response = await res.json(); status.responseData = response.message; } - } catch (err) { + } catch(err) { status.responseData = err; status.error = true; } @@ -126,7 +126,7 @@ export async function getPagesPrinted(email, token) { } else { status.error = true; } - } catch (err) { + } catch(err) { status.responseData = err; status.error = true; } diff --git a/src/APIFunctions/Advertisement.js b/src/APIFunctions/Advertisement.js index 55448d66f..7f60756cb 100644 --- a/src/APIFunctions/Advertisement.js +++ b/src/APIFunctions/Advertisement.js @@ -12,7 +12,7 @@ export async function getAd() { } else { status.error = true; } - } catch (err) { + } catch(err) { status.responseData = err; status.error = true; } @@ -35,7 +35,7 @@ export async function getAds(token) { } else { status.error = true; } - } catch (err) { + } catch(err) { status.responseData = err; status.error = true; } @@ -62,7 +62,7 @@ export async function createAd(newAd, token) { status.error = true; } - } catch (err) { + } catch(err) { status.responseData = err; status.error = true; } @@ -88,7 +88,7 @@ export async function deleteAd(newAd, token) { } else { status.error = true; } - } catch (err) { + } catch(err) { status.responseData = err; status.error = true; } diff --git a/src/APIFunctions/Auth.js b/src/APIFunctions/Auth.js index 5a1a01a90..b4cbd7024 100644 --- a/src/APIFunctions/Auth.js +++ b/src/APIFunctions/Auth.js @@ -51,7 +51,7 @@ export async function registerUser(userToRegister) { } else { status.error = true; } - } catch (err) { + } catch(err) { status.error = true; status.responseData = err.response; } @@ -84,7 +84,7 @@ export async function loginUser(email, password) { } else { status.error = true; } - } catch (err) { + } catch(err) { status.error = true; status.responseData = err.response; } @@ -124,7 +124,7 @@ export async function checkIfUserIsSignedIn() { status.responseData = result; status.token = token; } - } catch (err) { + } catch(err) { status.error = true; status.responseData = err; } @@ -155,7 +155,7 @@ export async function validateVerificationEmail(email, hashedId) { } else { status.error = true; } - } catch (err) { + } catch(err) { status.error = true; status.responseData = err.response; } @@ -186,7 +186,7 @@ export async function resetPassword(password, hashedId, resetToken) { } else { status.error = true; } - } catch (err) { + } catch(err) { status.error = true; status.responseData = err.response; } @@ -208,7 +208,7 @@ export async function validatePasswordReset(resetToken) { const result = await res.json(); status.responseData = result; } - } catch (err) { + } catch(err) { status.error = true; status.responseData = err.response; } diff --git a/src/APIFunctions/Cleezy.js b/src/APIFunctions/Cleezy.js index 489e21cee..09467ebaf 100644 --- a/src/APIFunctions/Cleezy.js +++ b/src/APIFunctions/Cleezy.js @@ -54,7 +54,7 @@ export async function createUrl(url, alias = null, token) { } else { status.error = true; } - } catch (err) { + } catch(err) { status.error = true; status.responseData = err; } @@ -73,7 +73,7 @@ export async function deleteUrl(aliasIn, token) { 'Content-Type': 'application/json' }, }); - } catch (err) { + } catch(err) { status.error = true; status.responseData = err; } From 382f9b7f3f14a325f8f958e377213c2f732ed025 Mon Sep 17 00:00:00 2001 From: DanielTQuach Date: Mon, 9 Jun 2025 01:32:37 -0700 Subject: [PATCH 08/12] mailer remove axios --- src/APIFunctions/Mailer.js | 66 ++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/src/APIFunctions/Mailer.js b/src/APIFunctions/Mailer.js index de4de98fa..57ad9c918 100644 --- a/src/APIFunctions/Mailer.js +++ b/src/APIFunctions/Mailer.js @@ -1,4 +1,3 @@ -import axios from 'axios'; import { ApiResponse } from './ApiResponses'; import { BASE_API_URL } from '../Enums'; @@ -12,25 +11,27 @@ import { BASE_API_URL } from '../Enums'; export async function sendVerificationEmail(email, token) { let status = new ApiResponse(); const url = new URL('/cloudapi/Auth/sendVerificationEmail', BASE_API_URL); - await axios - .post( - url.href, - { - email + try { + const res = await fetch(url.href, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}`, }, - { - headers: { - Authorization: `Bearer ${token}` - } - }, - ) - .then((response) => { - status.responseData = response; - }) - .catch((error) => { - status.error = true; - status.responseData = error; + body: JSON.stringify({ + email, + }), }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch(error) { + status.error = true; + status.responseData = error; + } return status; } @@ -43,16 +44,25 @@ export async function sendVerificationEmail(email, token) { export async function sendPasswordReset(email, captchaToken) { let status = new ApiResponse(); const url = new URL('/api/Auth/sendPasswordReset', BASE_API_URL); - await axios - .post(url.href, { - email, - captchaToken, - }) - .then((response) => { - status.responseData = response; - }) - .catch((error) => { - status.error = error; + try { + const res = await fetch(url.href, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + email, + captchaToken, + }), }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch(error) { + status.error = error; + } return status; } From 47f1e034b823d4295212532d992df13933206411 Mon Sep 17 00:00:00 2001 From: DanielTQuach Date: Mon, 9 Jun 2025 01:41:03 -0700 Subject: [PATCH 09/12] Speaker and Messaging remove axios --- src/APIFunctions/Messaging.js | 38 +++--- src/APIFunctions/Speaker.js | 224 ++++++++++++++++++++-------------- 2 files changed, 150 insertions(+), 112 deletions(-) diff --git a/src/APIFunctions/Messaging.js b/src/APIFunctions/Messaging.js index b2059192a..f08bbd3ea 100644 --- a/src/APIFunctions/Messaging.js +++ b/src/APIFunctions/Messaging.js @@ -1,28 +1,32 @@ -import axios from 'axios'; import { ApiResponse } from './ApiResponses'; import { BASE_API_URL } from '../Enums'; export async function sendMessage(id, token, message) { let status = new ApiResponse(); const roomId = id || 'general'; - const url = new URL('/api/messages/send', BASE_API_URL); - - await axios - .post(url.href, - { message, id: roomId }, - { - headers: { - 'authorization' : 'Bearer ' + token - } - }) - .then(res => { - status.responseData = res.data; - }) - .catch(err => { - status.error = true; - status.responseData = err; + try { + const res = await fetch(url.href, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}`, + }, + body: JSON.stringify({ + message, + id: roomId, + }), }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch(err) { + status.error = true; + status.responseData = error; + } return status; } diff --git a/src/APIFunctions/Speaker.js b/src/APIFunctions/Speaker.js index e579caaac..1946c29a7 100644 --- a/src/APIFunctions/Speaker.js +++ b/src/APIFunctions/Speaker.js @@ -1,4 +1,3 @@ -import axios from 'axios'; import { ApiResponse } from './ApiResponses'; import { BASE_API_URL } from '../Enums'; @@ -6,162 +5,197 @@ import { BASE_API_URL } from '../Enums'; export async function queued(token) { let status = new ApiResponse(); const url = new URL('/api/Speaker/queued', BASE_API_URL); - await axios - .get(url.href, { + try { + const res = await fetch(url.href, { + method: 'GET', headers: { - 'Authorization': `Bearer ${token}` + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}`, } - } - ) - .then(res => { - status.responseData = res.data.queue; - }) - .catch(err => { - status.responseData = err; - status.error = true; }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch(err) { + status.error = true; + status.responseData = error; + } return status; } export async function addUrl(urlToAdd, token) { let status = new ApiResponse(); const url = new URL('/api/Speaker/stream', BASE_API_URL); - await axios - .post(url.href, { - url: urlToAdd - }, { + try { + const res = await fetch(url.href, { + method: 'POST', headers: { - 'Authorization': `Bearer ${token}` - } - } - ) - .then(res => { - status = res.data; - }) - .catch(err => { - status.responseData = err; - status.error = true; + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}`, + }, + body: JSON.stringify({ + url: urlToAdd + }) }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch(err) { + status.error = true; + status.responseData = error; + } return status; } export async function skip(token) { let status = new ApiResponse(); const url = new URL('/api/Speaker/skip', BASE_API_URL); - await axios - .post(url.href, {}, { + try { + const res = await fetch(url.href, { + method: 'POST', headers: { - 'Authorization': `Bearer ${token}` + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}`, } - } - ) - .then(res => { - status = res.data; - }) - .catch(err => { - status.responseData = err; - status.error = true; }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch(err) { + status.error = true; + status.responseData = error; + } return status; } export async function pause(token) { let status = new ApiResponse(); const url = new URL('/api/Speaker/pause', BASE_API_URL); - await axios - .post(url.href, {}, { + try { + const res = await fetch(url.rhef, { + method: 'POST', headers: { - 'Authorization': `Bearer ${token}` + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}`, } - } - ) - .then(res => { - status = res.data; - }) - .catch(err => { - status.responseData = err; - status.error = true; }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch(err) { + status.error = true; + status.responseData = error; + } return status; } export async function resume(token) { let status = new ApiResponse(); const url = new URL('/api/Speaker/resume', BASE_API_URL); - await axios - .post(url.href, {}, { + try { + const res = await fetch(url.href, { + method: 'POST', headers: { - 'Authorization': `Bearer ${token}` + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}`, } - } - ) - .then(res => { - status = res.data; - }) - .catch(err => { - status.responseData = err; - status.error = true; }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch (err) { + status.error = true; + status.responseData = error; + } return status; } export async function setVolume(volumeToSet, token) { let status = new ApiResponse(); const url = new URL('/api/Speaker/volume', BASE_API_URL); - await axios - .post(url.href, { - volume: volumeToSet - }, { + try { + const res = await fetch(url.href, { + method: 'POST', headers: { - 'Authorization': `Bearer ${token}` - } - } - ) - .then(res => { - status = res.data; - }) - .catch(err => { - status.responseData = err; - status.error = true; + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}`, + }, + body: JSON.stringify({ + volume: volumeToSet + }) }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch(err) { + status.error = true; + status.responseData = error; + } + return status; } export async function rewind(token) { let status = new ApiResponse(); const url = new URL('/api/Speaker/rewind', BASE_API_URL); - await axios - .post(url.href, {}, { + try { + const res = await fetch(url.href, { + method: 'POST', headers: { - 'Authorization': `Bearer ${token}` + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}`, } - } - ) - .then(res => { - status = res.data; - }) - .catch(err => { - status.responseData = err; - status.error = true; }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch (err) { + status.error = true; + status.responseData = error; + } return status; } export async function forward(token) { let status = new ApiResponse(); const url = new URL('/api/Speaker/forward', BASE_API_URL); - await axios - .post(url.href, {}, { + try { + const res = await fetch(url.href, { + method: 'POST', headers: { - 'Authorization': `Bearer ${token}` + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}`, } - } - ) - .then(res => { - status = res.data; - }) - .catch(err => { - status.responseData = err; - status.error = true; }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch (err) { + status.error = true; + status.responseData = error; + } return status; } From aa0466389bce3df033d328c2c09540df70400aad Mon Sep 17 00:00:00 2001 From: DanielTQuach Date: Mon, 9 Jun 2025 01:51:47 -0700 Subject: [PATCH 10/12] User remove axios --- src/APIFunctions/User.js | 270 +++++++++++++++++++++++---------------- 1 file changed, 161 insertions(+), 109 deletions(-) diff --git a/src/APIFunctions/User.js b/src/APIFunctions/User.js index c72cc38da..78b87a82e 100644 --- a/src/APIFunctions/User.js +++ b/src/APIFunctions/User.js @@ -1,4 +1,3 @@ -import axios from 'axios'; import { UserApiResponse } from './ApiResponses'; import { BASE_API_URL, membershipState, userFilterType } from '../Enums'; @@ -26,26 +25,27 @@ export async function getAllUsers({ } let status = new UserApiResponse(); - await axios - // get all users! - .post( - url.href, - { + try { + const res = await fetch(url.href, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}`, + }, + body: JSON.stringify({ query, page, - }, - { - headers: { - Authorization: `Bearer ${token}` - } - } - ) - .then(result => { - status.responseData = result.data; - }) - .catch(() => { - status.error = true; + }), }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch(err) { + status.error = true; + } return status; } @@ -102,36 +102,42 @@ export async function editUser(userToEdit, token) { emailOptIn, } = userToEdit; const url = new URL('/api/User/edit', BASE_API_URL); - await axios - .post(url.href, { - _id, - firstName, - lastName, - email, - password, - major, - numberOfSemestersToSignUpFor, - doorCode, - discordUsername, - discordDiscrim, - discordID, - pagesPrinted, - accessLevel, - lastLogin, - emailVerified, - emailOptIn - }, { + try { + const res = await fetch(url.href, { + method: 'POST', headers: { - Authorization: `Bearer ${token}` - } - }) - .then(result => { - status.responseData = result.data; - }) - .catch(err => { - status.error = true; - status.responseData = err.response; + 'Content-Type': 'application/json', + Authorization: `Bearer ${token.headers.Authorization.split(' ')[1]}`, + }, + body: JSON.stringify({ + _id, + firstName, + lastName, + email, + password, + major, + numberOfSemestersToSignUpFor, + doorCode, + discordUsername, + discordDiscrim, + discordID, + pagesPrinted, + accessLevel, + lastLogin, + emailVerified, + emailOptIn + }) }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch(err) { + status.error = true; + status.responseData = err.response; + } return status; } @@ -157,117 +163,163 @@ export async function updateLastLoginDate(email, token) { export async function deleteUserByID(_id, token) { let status = new UserApiResponse(); const url = new URL('/api/User/delete', BASE_API_URL); - axios - .post(url.href, { - _id, - }, { + try { + const res = await fetch(url.href, { + method: 'POST', headers: { - Authorization: `Bearer ${token}` - } - }) - .catch(() => { - status.error = true; + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}`, + }, + body: JSON.stringify({ _id }), }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch(err) { + status.error = true; + } return status; } export async function getUserById(userID, token) { let status = new UserApiResponse(); const url = new URL('/api/User/getUserById', BASE_API_URL); - await axios.post(url.href, - {userID}, { + try { + const res = await fetch(url.href, { + method: 'POST', headers: { - Authorization: `Bearer ${token}` - } - }) - .then((res) => { - status.responseData = res.data; - }) - .catch((err) => { - status.error = true; + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}`, + }, + body: JSON.stringify({ userID }), }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch(err) { + status.error = true; + } return status; } export async function setUserEmailPreference(email, emailOptIn) { let status = new UserApiResponse(); const url = new URL('/api/User/setUserEmailPreference', BASE_API_URL); - await axios - .post(url.href, { - email, - emailOptIn, - }) - .then((res) => { - status.responseData = res.data; - }) - .catch((err) => { - status.error = true; + try { + const res = await fetch(url.href, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + email, + emailOptIn, + }), }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch(err) { + status.error = true; + } return status; } export async function getUserData(email) { let status = new UserApiResponse(); const url = new URL('/api/User/getUserDataByEmail', BASE_API_URL); - await axios - .post(url.href, { - email, - }) - .then((res) => { - status.responseData = res.data; - }) - .catch((err) => { - status.error = true; + try { + const res = await fetch(url.href, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ email }), }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch(err) { + status.error = true; + } return status; } export async function getAllUserSubscribedAndVerified(token) { let status = new UserApiResponse(); const url = new URL('/api/User/usersSubscribedAndVerified', BASE_API_URL); - await axios - .post(url.href, { + try { + const res = await fetch(url.href, { + method: 'POST', headers: { - Authorization: `Bearer ${token}` - } - }) - .then((res) => { - status.responseData = res.data; - }) - .catch((err) => { - status.error = true; + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}`, + }, }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch(err) { + status.error = true; + } return status; } export async function getAllUsersValidVerifiedAndSubscribed(token) { let status = new UserApiResponse(); const url = new URL('/api/User/usersValidVerifiedAndSubscribed', BASE_API_URL); - await axios - .post(url.href, { responseType: 'blob' }, { + try { + const res = await fetch(url.href, { + method: 'POST', headers: { - Authorization: `Bearer ${token}` - } - }) - .then((res) => { - status.responseData = res.data; - }) - .catch((err) => { - status.error = err; + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}`, + }, }); + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } + } catch(err) { + status.error = true; + } return status; } export async function getApiKey(token) { let status = new UserApiResponse(); + const url = new URL('/api/User/apiKey', BASE_API_URL); try { - const url = new URL('/api/User/apiKey', BASE_API_URL); - const response = await axios.post(url.href, {}, { + const res = await fetch(url.href, { + method: 'POST', headers: { - Authorization: `Bearer ${token}` - } + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}`, + }, }); - status.responseData = response.data; + if (res.ok) { + const result = await res.json(); + status.responseData = result; + } else { + status.error = true; + } } catch (error) { status.error = true; } From d3e55751f56f2b09dfbc090db46dada9f50b4e02 Mon Sep 17 00:00:00 2001 From: DanielTQuach Date: Mon, 9 Jun 2025 22:43:34 -0700 Subject: [PATCH 11/12] fix build compile error --- src/APIFunctions/Advertisement.js | 2 +- src/APIFunctions/Auth.js | 4 ++-- src/APIFunctions/Cleezy.js | 2 +- src/APIFunctions/Speaker.js | 2 +- src/APIFunctions/User.js | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/APIFunctions/Advertisement.js b/src/APIFunctions/Advertisement.js index 7f60756cb..ce9b8b8f0 100644 --- a/src/APIFunctions/Advertisement.js +++ b/src/APIFunctions/Advertisement.js @@ -5,7 +5,7 @@ import { BASE_API_URL } from '../Enums'; export async function getAd() { let status = new ApiResponse(); try { - const res = await fetch (BASE_API_URL + '/api/Advertisement/') + const res = await fetch (BASE_API_URL + '/api/Advertisement/'); if (res.ok) { const result = await res.json(); status.responseData = result; diff --git a/src/APIFunctions/Auth.js b/src/APIFunctions/Auth.js index b4cbd7024..c9d25f5b9 100644 --- a/src/APIFunctions/Auth.js +++ b/src/APIFunctions/Auth.js @@ -142,7 +142,7 @@ export async function validateVerificationEmail(email, hashedId) { let status = new ApiResponse(); const url = new URL('/api/Auth/validateVerificationEmail', BASE_API_URL); try { - const res = await fetch(url.href, { + const res = await fetch(url.href, { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -203,7 +203,7 @@ export async function validatePasswordReset(resetToken) { 'Content-Type': 'application/json' }, body: JSON.stringify({ resetToken }) - }); + }); if (res.ok) { const result = await res.json(); status.responseData = result; diff --git a/src/APIFunctions/Cleezy.js b/src/APIFunctions/Cleezy.js index 09467ebaf..25d3a33be 100644 --- a/src/APIFunctions/Cleezy.js +++ b/src/APIFunctions/Cleezy.js @@ -38,8 +38,8 @@ export async function getAllUrls({ export async function createUrl(url, alias = null, token) { let status = new ApiResponse(); const urlToAdd = { url, alias }; - const url = new URL('/api/Cleezy/createUrl', BASE_API_URL); try { + const url = new URL('/api/Cleezy/createUrl', BASE_API_URL); const res = await fetch(url.href, { method: 'POST', headers: { diff --git a/src/APIFunctions/Speaker.js b/src/APIFunctions/Speaker.js index 1946c29a7..a654022b9 100644 --- a/src/APIFunctions/Speaker.js +++ b/src/APIFunctions/Speaker.js @@ -22,7 +22,7 @@ export async function queued(token) { } catch(err) { status.error = true; status.responseData = error; - } + } return status; } diff --git a/src/APIFunctions/User.js b/src/APIFunctions/User.js index 78b87a82e..178f98ab1 100644 --- a/src/APIFunctions/User.js +++ b/src/APIFunctions/User.js @@ -44,7 +44,7 @@ export async function getAllUsers({ status.error = true; } } catch(err) { - status.error = true; + status.error = true; } return status; } From 845606acdc93d3ee9893413b97cbba31be4d58c5 Mon Sep 17 00:00:00 2001 From: DanielTQuach Date: Mon, 9 Jun 2025 22:45:41 -0700 Subject: [PATCH 12/12] uninstall axios --- package-lock.json | 152 ---------------------------------------------- package.json | 1 - 2 files changed, 153 deletions(-) diff --git a/package-lock.json b/package-lock.json index 138a35e04..bd4b41d69 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,6 @@ "license": "MIT", "dependencies": { "@cfaester/enzyme-adapter-react-18": "^0.8.0", - "axios": "^0.21.0", "bcryptjs": "^2.4.3", "bluebird": "^3.7.2", "cors": "^2.8.5", @@ -4900,14 +4899,6 @@ "node": ">=4" } }, - "node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, "node_modules/axobject-query": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz", @@ -5517,17 +5508,6 @@ "node": ">=0.6.19" } }, - "node_modules/btoa": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz", - "integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g==", - "bin": { - "btoa": "bin/btoa.js" - }, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", @@ -18568,114 +18548,6 @@ "node": ">=0.10.0" } }, - "node_modules/source-map-explorer": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/source-map-explorer/-/source-map-explorer-2.5.3.tgz", - "integrity": "sha512-qfUGs7UHsOBE5p/lGfQdaAj/5U/GWYBw2imEpD6UQNkqElYonkow8t+HBL1qqIl3CuGZx7n8/CQo4x1HwSHhsg==", - "dependencies": { - "btoa": "^1.2.1", - "chalk": "^4.1.0", - "convert-source-map": "^1.7.0", - "ejs": "^3.1.5", - "escape-html": "^1.0.3", - "glob": "^7.1.6", - "gzip-size": "^6.0.0", - "lodash": "^4.17.20", - "open": "^7.3.1", - "source-map": "^0.7.4", - "temp": "^0.9.4", - "yargs": "^16.2.0" - }, - "bin": { - "sme": "bin/cli.js", - "source-map-explorer": "bin/cli.js" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/source-map-explorer/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/source-map-explorer/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/source-map-explorer/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/source-map-explorer/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/source-map-explorer/node_modules/open": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", - "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", - "dependencies": { - "is-docker": "^2.0.0", - "is-wsl": "^2.1.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/source-map-explorer/node_modules/source-map": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", - "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/source-map-explorer/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", @@ -19587,18 +19459,6 @@ "bintrees": "1.0.2" } }, - "node_modules/temp": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/temp/-/temp-0.9.4.tgz", - "integrity": "sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA==", - "dependencies": { - "mkdirp": "^0.5.1", - "rimraf": "~2.6.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/temp-dir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", @@ -19607,18 +19467,6 @@ "node": ">=8" } }, - "node_modules/temp/node_modules/rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, "node_modules/tempy": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tempy/-/tempy-0.6.0.tgz", diff --git a/package.json b/package.json index 520faaf4d..2aba6a7d8 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,6 @@ "license": "MIT", "dependencies": { "@cfaester/enzyme-adapter-react-18": "^0.8.0", - "axios": "^0.21.0", "bcryptjs": "^2.4.3", "bluebird": "^3.7.2", "cors": "^2.8.5",