Skip to content

Commit

Permalink
addressed feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuart6557 committed Apr 17, 2024
1 parent 0dd8290 commit fa857b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const config = {
grantPastAttendance: '/admin/attendance',
awardMilestone: '/admin/milestone',
viewResumes: '/admin/resumes',
manageUserAccess: '/admin/manage-user-access',
manageUserAccess: '/admin/access',
store: {
items: '/admin/store/items',
pickup: '/admin/store/pickup',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,12 @@ import manageUserAccess from '@/lib/managers/AdminUserManager';
import { PermissionService, ValidationService } from '@/lib/services';
import { UserAccessUpdates } from '@/lib/types/apiRequests';
import { UserAccessType } from '@/lib/types/enums';
import { getMessagesFromError } from '@/lib/utils';
import { AxiosError } from 'axios';
import { reportError } from '@/lib/utils';
import { GetServerSideProps } from 'next';
import { SubmitHandler, useForm } from 'react-hook-form';
import { AiOutlineMail } from 'react-icons/ai';
import { BsPerson } from 'react-icons/bs';

// This function needs to be moved to the util class after Sean's PR is merged
function reportError(title: string, error: unknown) {
if (error instanceof AxiosError && error.response?.data?.error) {
showToast(title, getMessagesFromError(error.response.data.error).join('\n\n'));
} else if (error instanceof Error) {
showToast(title, error.message);
} else {
showToast(title, 'Unknown error');
}
}

const ManageUserAccessPage = () => {
const {
register,
Expand Down

0 comments on commit fa857b7

Please sign in to comment.