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


export const registerApi = createApi({
    reducerPath: 'registerApi',
    baseQuery: baseQueryWithAuth,
    tagTypes: ['Register'],
    endpoints: (builder) => ({
        register: builder.mutation({
            query: (credentials) => ({
                url: '/register/',
                method: 'POST',
                body: credentials,
            }),
        }),
    }),
});

export const {useRegisterMutation} = registerApi;
