Skip to content

Commit

Permalink
Upgrade met-web to axios version 0.28.0 from 0.26.1 (#2451)
Browse files Browse the repository at this point in the history
* Upgrade met-web to axios version 0.28.0 from 0.26.1
  • Loading branch information
VineetBala-AOT authored Apr 8, 2024
1 parent 13729fb commit e527862
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 20 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
- **Bugfix**: Submission of rejected comments [🎟️ DESENG-527](https://apps.itsm.gov.bc.ca/jira/browse/DESENG-527)
- Fixed issue where resubmitted comments would not reappear in the queue for approval.
- Added unit tests to ensure the issue does not reoccur.
- **Task**: MET - Clean up outstanding dependabot PRs [DESENG-535](https://apps.itsm.gov.bc.ca/jira/browse/DESENG-535)
- Bump axios from 0.26.1 to 0.28.0 in met-web. Dependabot suggested this upgrade, but it required a few minor code changes.
- Updated the type definition of the 'error' parameter to include a generic type '{ message?: string }' to handle the AxiosError response properly.

## April 05, 2024

Expand Down
34 changes: 23 additions & 11 deletions met-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion met-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@types/react-dom": "^18.0.2",
"@types/react-draft-wysiwyg": "^1.13.4",
"@types/react-redux": "^7.1.24",
"axios": "^0.26.1",
"axios": "^0.28.0",
"date-fns": "^2.28.0",
"date-fns-tz": "^1.3.4",
"dayjs": "^1.11.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ export const AddTeamMemberModal = () => {
}, 1000),
).current;

const setErrors = (error: AxiosError) => {
const setErrors = (error: AxiosError<{ message?: string }>) => {
if (error.response?.status !== 409) {
return;
}
setBackendError(error.response?.data.message || '');
setBackendError(error.response?.data?.message || '');
};

const onSubmit: SubmitHandler<AddTeamMemberForm> = async (data: AddTeamMemberForm) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ export const AddUserModal = () => {
);
};

const setErrors = (error: AxiosError) => {
const setErrors = (error: AxiosError<{ message?: string }>) => {
if (error.response?.status !== 409) {
return;
}
setBackendError(error.response?.data.message || '');
setBackendError(error.response?.data?.message || '');
};

const onSubmit: SubmitHandler<AddUserForm> = async (data: AddUserForm) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ export const AssignRoleModal = () => {
setBackendError('');
};

const setErrors = (error: AxiosError) => {
const setErrors = (error: AxiosError<{ message?: string }>) => {
if (error.response?.status !== 409) {
return;
}
setBackendError(error.response?.data.message || '');
setBackendError(error.response?.data?.message || '');
};

const loadEngagements = async (searchText: string) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ export const AddToEngagementModal = () => {
getUserMemberships();
};

const setErrors = (error: AxiosError) => {
const setErrors = (error: AxiosError<{ message?: string }>) => {
if (error.response?.status !== HTTP_STATUS_CODES.CONFLICT) {
return;
}
setBackendError(error.response?.data.message || '');
setBackendError(error.response?.data?.message || '');
};

const onSubmit: SubmitHandler<AddUserForm> = async (data: AddUserForm) => {
Expand Down

0 comments on commit e527862

Please sign in to comment.