import { apiSlice } from '../api/apiSlice';

const settingsApi = apiSlice.injectEndpoints({
  endpoints: (builder) => ({
    getSettings: builder.query({
      query: () => `settings`,
      providesTags: ['Settings'],
    }),
    changeSettings: builder.mutation({
      query: (body) => ({
        url: `settings`,
        method: 'POST',
        body,
      }),
      invalidatesTags: ['Settings'],
    }),
  }),
});

export const { useGetSettingsQuery, useChangeSettingsMutation } = settingsApi;
