Commit 0ef0cd92 authored by guillecxb's avatar guillecxb
Browse files

get and delete working

parent a5b272b8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
NEXT_PUBLIC_JWT_EXPIRATION=5m
NEXT_PUBLIC_JWT_SECRET=dd5f3089-40c3-403d-af14-d0c228b05cb4
NEXT_PUBLIC_JWT_REFRESH_TOKEN_SECRET=7c4c1c50-3230-45bf-9eae-c9b2e401c767
NEXT_PUBLIC_API_BASE_URL="https://backoffice-api.mobilesandbox.cloud:38443"
# NEXT_PUBLIC_API_BASE_URL="https://backoffice-api.mobilesandbox.cloud:38443"
NEXT_PUBLIC_API_BASE_URL="http://localhost:8085/api"
NEXT_PUBLIC_GRAFANA_BASE_URL="https://grafana.5gnacar.int"
NODE_ENV=development
+2 −2
Original line number Diff line number Diff line
@@ -209,10 +209,10 @@ export const deleteUser = async (username, password) => {
  return axiosInstance.delete(`/${username}/${password}`)
}

export const deleteUsers = async (users) => {
export const deleteUsers = async (uuids) => {
  try {
    const data = {
      users: users.map(({ username, password }) => ({ username, password }))
      uuids: uuids
    };

    const response = await axiosInstance.delete('/users/', {
+4 −4
Original line number Diff line number Diff line
@@ -34,10 +34,10 @@ axiosInstance.interceptors.request.use(
    //console.log('Interceptor request accessToken', accessToken)

    // if token exist and request is not refresh, add token to headers
    if (accessToken && req.url !== '/refresh') {
    if (accessToken && req.url !== '/api/refresh') {
      req.headers['Authorization'] = `Bearer ${accessToken}`
    }
    if (req.url === '/refresh' && refreshToken) {
    if (req.url === '/api/refresh' && refreshToken) {
      const refreshToken = getRefreshToken()
      req.headers['Authorization'] = `Bearer ${refreshToken}`
    }
@@ -76,8 +76,8 @@ axiosInstance.interceptors.response.use(
    if (
      error.response &&
      error.response.status === 401 &&
      error.response.config.url !== '/auth/me' &&
      error.response.config.url !== '/refresh'
      error.response.config.url !== '/api/auth/me' &&
      error.response.config.url !== '/api/refresh'
    ) {
      // try to refresh token
      const refreshToken = getRefreshToken()
+1 −1
Original line number Diff line number Diff line
@@ -298,7 +298,7 @@ const Homedash = () => {
              >
                <CardContent style={{ textAlign: 'center' }}>
                  <Typography variant='h5'>Users:</Typography>
                  <Typography variant='h4' sx={{ marginBottom: 6 }}>{usersNum?.data}</Typography>
                  <Typography variant='h4' sx={{ marginBottom: 6 }}>{usersData?.total}</Typography>
                  {!usersData?.data && <CircularProgress />}
                  {usersData?.data && (
                    <>
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ const Invokers = () => {
  const [selectedInvoker, setSelectedInvoker] = useState(null);
  const [isDeleteDialogOpen, setDeleteDialogOpen] = useState(false);
  const [currentPage, setCurrentPage] = useState(1);
  const [pageSize, setPageSize] = useState(10); // Número de invocadores por página
  const [pageSize, setPageSize] = useState(10);
  const [totalPages, setTotalPages] = useState(0);
  const [totalInvokers, setTotalInvokers] = useState(0);
  const [invokers, setInvokers] = useState([]);
Loading