Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Mike Cao 2023-05-16 19:17:28 -07:00
commit e98c0a62e3
4 changed files with 6 additions and 4 deletions

View File

@ -52,6 +52,8 @@ export function BarChart({
return dateFormat(d, 'MMM d', locale);
case 'month':
return dateFormat(d, 'MMM', locale);
case 'year':
return dateFormat(d, 'YYY', locale);
default:
return label;
}

View File

@ -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 (
<Form onSubmit={handleSubmit} error={error}>
<p>
<FormattedMessage {...messages.confirmLeave} values={{ name: <b>{teamName}</b> }} />
<FormattedMessage {...messages.confirmDelete} values={{ target: <b>{teamName}</b> }} />
</p>
<FormButtons flex>
<SubmitButton variant="danger" disabled={isLoading}>

View File

@ -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(

View File

@ -50,7 +50,7 @@ export default async (
return ok(res, {
token,
user: { id: user.id, username: user.username, createdAt: user.createdAt },
user: { id: user.id, username: user.username, role: user.role, createdAt: user.createdAt },
});
}