import {createApi} from "@reduxjs/toolkit/query/react";
import {baseQueryWithAuth} from "./baseQuery.js";


export const rolesApi = createApi({
    reducerPath: 'rolesApi',
    baseQuery: baseQueryWithAuth,
    tagTypes: ['Roles'],
    endpoints: (builder) => ({
        getRoles: builder.query({
            query: () => '/roles/',
            providesTags: ['Roles'],
            refetchOnMountOrArgChange: 5,
        }),
    }),
});

export const {useGetRolesQuery} = rolesApi;