Skip to content

Commit

Permalink
fix: update axios min version to 0.21.2 (#494)
Browse files Browse the repository at this point in the history
* fix: update axios patch version

* fix: types in useAlerts
  • Loading branch information
jacobvenable authored Oct 12, 2021
1 parent c22aaf9 commit 774d04f
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"@upswyng/types": "0.1.0",
"axios": ">=0.21.1",
"axios": ">=0.21.2",
"canonical-instance": "^2.0.0",
"compression": "^1.7.1",
"cors": "^2.8.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@slack/web-api": "^5.6.0",
"@upswyng/common": "0.1.0",
"@upswyng/types": "0.1.0",
"axios": ">=0.21.1",
"axios": ">=0.21.2",
"body-parser": "^1.19.0",
"bson": "^4.0.2",
"bullmq": "^1.6.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@types/react-router-dom": "^5.1.0",
"@upswyng/common": "0.1.0",
"algoliasearch": "^3.33.0",
"axios": ">=0.21.1",
"axios": ">=0.21.2",
"debounce": "^1.2.0",
"google-map-react": "^1.1.4",
"html-react-parser": "^0.11.1",
Expand Down
8 changes: 6 additions & 2 deletions packages/web/src/components/useAlerts.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { TAlert, TStatusFetch } from "@upswyng/types";
import { TAlertsBody, TAlertsPayload } from "../webTypes";
import { useEffect, useState } from "react";
import { AxiosResponse } from "axios";

import { TAlertsPayload } from "../webTypes";
import apiClient from "../utils/apiClient";

const GET_ALERTS_INTERVAL_MS = 300000; // 5 minutes
Expand All @@ -16,7 +17,10 @@ const useAlerts = (): [TStatusFetch, TAlert[] | null] => {
const getAlerts = async (): Promise<void> => {
try {
setStatus(TStatusFetch.STATUS_FETCHING);
const { data } = await apiClient.post<TAlertsPayload>(`/alert/search`, {
const { data } = await apiClient.post<
TAlertsBody,
AxiosResponse<TAlertsPayload>
>(`/alert/search`, {
start: new Date(),
});

Expand Down
4 changes: 4 additions & 0 deletions packages/web/src/webTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export interface TEnvVariables {
};
}

export interface TAlertsBody {
start: Date;
}

interface TPayloadBase {
message?: string;
}
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3373,12 +3373,12 @@ aws4@^1.8.0:
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.9.1.tgz#7e33d8f7d449b3f673cd72deb9abdc552dbe528e"
integrity sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==

axios@>=0.21.1:
version "0.21.1"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8"
integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==
axios@>=0.21.2:
version "0.22.0"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.22.0.tgz#bf702c41fb50fbca4539589d839a077117b79b25"
integrity sha512-Z0U3uhqQeg1oNcihswf4ZD57O3NrR1+ZXhxaROaWpDmsDTx7T2HNBV2ulBtie2hwJptu8UvgnJoK+BIqdzh/1w==
dependencies:
follow-redirects "^1.10.0"
follow-redirects "^1.14.4"

axios@^0.19.0:
version "0.19.2"
Expand Down Expand Up @@ -7157,10 +7157,10 @@ follow-redirects@^1.0.0:
dependencies:
debug "^3.0.0"

follow-redirects@^1.10.0:
version "1.13.2"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.2.tgz#dd73c8effc12728ba5cf4259d760ea5fb83e3147"
integrity sha512-6mPTgLxYm3r6Bkkg0vNM0HTjfGrOEtsfbhagQvbxDEsEkpNhw582upBaoRZylzen6krEmxXJgt9Ju6HiI4O7BA==
follow-redirects@^1.14.4:
version "1.14.4"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.4.tgz#838fdf48a8bbdd79e52ee51fb1c94e3ed98b9379"
integrity sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==

fontfaceobserver@^2.1.0:
version "2.1.0"
Expand Down

0 comments on commit 774d04f

Please sign in to comment.