<commit_before>import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
import axios from "axios";
import { setBaseUrl } from "../../utilities/url-utilities";

const BASE_URL = setBaseUrl(`ajax/users`);

/**
 * Redux API for users.
 */
export const usersApi = createApi({
  reducerPath: `usersApi`,
  baseQuery: fetchBaseQuery({
    baseUrl: setBaseUrl(BASE_URL),
  }),
  tagTypes: ["Users", "Projects"],
  endpoints: (build) => ({
    /*
    Get user details.
     */
    getUserDetails: build.query({
      query: (userId) => ({
        url: `/${userId}`,
      }),
      providesTags: ["Users"],
    }),
    /*
    Edit user details.
    */
    editUserDetails: build.mutation({
      query: ({
        userId,
        firstName,
        lastName,
        email,
        phoneNumber,
        role,
        locale,
        enabled,
      }) => ({
        url: `/${userId}/edit`,
        body: {
          firstName,
          lastName,
          email,
          phoneNumber,
          systemRole: role,
          locale,
          enabled,
        },
        method: "POST",
      }),
      invalidatesTags: ["Users"],
    }),
    /*
    Change user password.
    */
    changeUserPassword: build.mutation({
      query: ({ userId, oldPassword, newPassword }) => ({
        url: `/${userId}/changePassword`,
        params: { oldPassword, newPassword },
        method: "POST",
      }),
      invalidatesTags: ["Users"],
    }),
    /*
    Update the disabled status of a user by user id.
    */
    setUsersDisabledStatus: build.mutation({
      query: ({ isEnabled, id }) => ({
        url: `/edit`,
        params: { isEnabled, id },
        method: "PUT",
      }),
    }),
  }),
});

export const {
  useGetUserDetailsQuery,
  useGetUserProjectDetailsQuery,
  useEditUserDetailsMutation,
  useChangeUserPasswordMutation,
  useSetUsersDisabledStatusMutation
} = usersApi;<commit_msg>fixing export in users.js<commit_after>import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
import axios from "axios";
import { setBaseUrl } from "../../utilities/url-utilities";

const BASE_URL = setBaseUrl(`ajax/users`);

/**
 * Redux API for users.
 */
export const usersApi = createApi({
  reducerPath: `usersApi`,
  baseQuery: fetchBaseQuery({
    baseUrl: setBaseUrl(BASE_URL),
  }),
  tagTypes: ["Users", "Projects"],
  endpoints: (build) => ({
    /*
    Get user details.
     */
    getUserDetails: build.query({
      query: (userId) => ({
        url: `/${userId}`,
      }),
      providesTags: ["Users"],
    }),
    /*
    Edit user details.
    */
    editUserDetails: build.mutation({
      query: ({
        userId,
        firstName,
        lastName,
        email,
        phoneNumber,
        role,
        locale,
        enabled,
      }) => ({
        url: `/${userId}/edit`,
        body: {
          firstName,
          lastName,
          email,
          phoneNumber,
          systemRole: role,
          locale,
          enabled,
        },
        method: "POST",
      }),
      invalidatesTags: ["Users"],
    }),
    /*
    Change user password.
    */
    changeUserPassword: build.mutation({
      query: ({ userId, oldPassword, newPassword }) => ({
        url: `/${userId}/changePassword`,
        params: { oldPassword, newPassword },
        method: "POST",
      }),
      invalidatesTags: ["Users"],
    }),
    /*
    Update the disabled status of a user by user id.
    */
    setUsersDisabledStatus: build.mutation({
      query: ({ isEnabled, id }) => ({
        url: `/edit`,
        params: { isEnabled, id },
        method: "PUT",
      }),
    }),
  }),
});

export const {
  useGetUserDetailsQuery,
  useEditUserDetailsMutation,
  useChangeUserPasswordMutation,
  useSetUsersDisabledStatusMutation
} = usersApi;
{'fraction_non_alphanumeric': 0.14650856389986824, 'fraction_numerical': 0.0, 'mean_word_length': 2.0662358642972536, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5893528', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1146, 'n_words': 247}