import { createSlice } from '@reduxjs/toolkit';

const initialState = {
  email: '',
  code: '',
  password: '',
  password2: '',
};

export const slice = createSlice({
  name: '@@auth/CREATE_RESET_PASSWORD',
  initialState,
  reducers: {
    setFieldAction: (state, action) => {
      Object.entries(action.payload).forEach(([key, value]) => {
        state[key] = value;
      });
    },
    verifyCodeAction: (state) => state,
    submitPasswordAction: (state) => state,
  },
});

export const { setFieldAction, verifyCodeAction, submitPasswordAction } = slice.actions;
