From f528fac7be6e47bd20a306ef408d77b0dc75bb8d Mon Sep 17 00:00:00 2001 From: Francis Cao Date: Tue, 16 May 2023 11:06:42 -0700 Subject: [PATCH] fix teams api route and messaging --- components/pages/settings/teams/TeamLeaveForm.js | 4 ++-- components/pages/settings/teams/TeamMemberRemoveButton.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/pages/settings/teams/TeamLeaveForm.js b/components/pages/settings/teams/TeamLeaveForm.js index 9b61d4d9..954006ab 100644 --- a/components/pages/settings/teams/TeamLeaveForm.js +++ b/components/pages/settings/teams/TeamLeaveForm.js @@ -5,7 +5,7 @@ import useMessages from 'hooks/useMessages'; export function TeamLeaveForm({ teamId, userId, teamName, onSave, onClose }) { const { formatMessage, labels, messages, FormattedMessage } = useMessages(); const { del, useMutation } = useApi(); - const { mutate, error, isLoading } = useMutation(() => del(`/team/${teamId}/users/${userId}`)); + const { mutate, error, isLoading } = useMutation(() => del(`/teams/${teamId}/users/${userId}`)); const handleSubmit = async () => { mutate( @@ -22,7 +22,7 @@ export function TeamLeaveForm({ teamId, userId, teamName, onSave, onClose }) { return (

- {teamName} }} /> + {teamName} }} />

diff --git a/components/pages/settings/teams/TeamMemberRemoveButton.js b/components/pages/settings/teams/TeamMemberRemoveButton.js index 9dde180b..9f326476 100644 --- a/components/pages/settings/teams/TeamMemberRemoveButton.js +++ b/components/pages/settings/teams/TeamMemberRemoveButton.js @@ -5,7 +5,7 @@ import { Icon, Icons, LoadingButton, Text } from 'react-basics'; export function TeamMemberRemoveButton({ teamId, userId, disabled, onSave }) { const { formatMessage, labels } = useMessages(); const { del, useMutation } = useApi(); - const { mutate, isLoading } = useMutation(() => del(`/team/${teamId}/users/${userId}`)); + const { mutate, isLoading } = useMutation(() => del(`/teams/${teamId}/users/${userId}`)); const handleRemoveTeamMember = () => { mutate(