Merge pull request 'fix: remove unused code for build' (#1) from features/refactor into dev
Reviewed-on: winter-access/frontend-nam#1
This commit is contained in:
commit
f4e955ade4
|
|
@ -20,7 +20,7 @@ interface SidebarProps {
|
|||
handleLogout: () => void;
|
||||
}
|
||||
|
||||
const Sidebar: React.FC<SidebarProps> = ({ sidebarOpen, user, handleLogout }) => {
|
||||
const Sidebar: React.FC<SidebarProps> = ({ sidebarOpen, user }) => {
|
||||
return (
|
||||
<aside
|
||||
className={`
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useState } from 'react';
|
||||
import { NavLink, Outlet, useNavigate } from 'react-router';
|
||||
import { Outlet, useNavigate } from 'react-router';
|
||||
import { useAuthStore } from '../../features/auth/store';
|
||||
import Sidebar from './Dashboard/Sidebar'; // Import the Sidebar component we created earlier
|
||||
import Header from './Dashboard/Header';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import { apiClient, ApiResponse, extractApiErrors } from '../../../lib/api-client';
|
||||
import { apiClient, ApiResponse } from '../../../lib/api-client';
|
||||
// import { toast } from 'react-hot-toast';
|
||||
|
||||
// Tipe untuk model User
|
||||
|
|
@ -68,12 +68,12 @@ export const useCreateUser = () => {
|
|||
queryClient.invalidateQueries({ queryKey: ['users'] });
|
||||
// toast.success('Pengguna berhasil dibuat');
|
||||
},
|
||||
onError: (error: unknown) => {
|
||||
const errors = extractApiErrors(error);
|
||||
Object.values(errors).forEach((message) => {
|
||||
// toast.error(message);
|
||||
});
|
||||
},
|
||||
// onError: (error: unknown) => {
|
||||
// const errors = extractApiErrors(error);
|
||||
// Object.values(errors).forEach((message) => {
|
||||
// // toast.error(message);
|
||||
// });
|
||||
// },
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -94,12 +94,12 @@ export const useUpdateUser = () => {
|
|||
queryClient.invalidateQueries({ queryKey: ['users', data.id] });
|
||||
// toast.success('Pengguna berhasil diperbarui');
|
||||
},
|
||||
onError: (error: unknown) => {
|
||||
const errors = extractApiErrors(error);
|
||||
Object.values(errors).forEach((message) => {
|
||||
// toast.error(message);
|
||||
});
|
||||
},
|
||||
// onError: (error: unknown) => {
|
||||
// const errors = extractApiErrors(error);
|
||||
// Object.values(errors).forEach((message) => {
|
||||
// // toast.error(message);
|
||||
// });
|
||||
// },
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -118,11 +118,11 @@ export const useDeleteUser = () => {
|
|||
queryClient.invalidateQueries({ queryKey: ['users'] });
|
||||
// toast.success('Pengguna berhasil dihapus');
|
||||
},
|
||||
onError: (error: unknown) => {
|
||||
const errors = extractApiErrors(error);
|
||||
Object.values(errors).forEach((message) => {
|
||||
// toast.error(message);
|
||||
});
|
||||
},
|
||||
// onError: (error: unknown) => {
|
||||
// const errors = extractApiErrors(error);
|
||||
// Object.values(errors).forEach((message) => {
|
||||
// // toast.error(message);
|
||||
// });
|
||||
// },
|
||||
});
|
||||
};
|
||||
|
|
@ -30,7 +30,7 @@ apiClient.interceptors.response.use(
|
|||
return response;
|
||||
},
|
||||
(error: AxiosError) => {
|
||||
const { response } = error;
|
||||
// const { response } = error;
|
||||
|
||||
// Handle expired token atau unauthorized
|
||||
// if (response?.status === 401) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { useState } from "react";
|
||||
import { useNavigate } from "react-router";
|
||||
import { useLogin } from "../../features/auth/api/auth";
|
||||
import axios from "axios";
|
||||
import Input from "@/components/forms/Input";
|
||||
|
|
@ -8,7 +7,6 @@ import Card from "@/components/data_display/Card/Card";
|
|||
import Button from "@/components/actions/Button";
|
||||
|
||||
const LoginPage = () => {
|
||||
const navigate = useNavigate();
|
||||
const [errors, setErrors] = useState<Record<string, string>>({});
|
||||
|
||||
const { ...login } = useLogin({
|
||||
|
|
|
|||
Loading…
Reference in New Issue