import { createAction, createAsyncThunk } from '@reduxjs/toolkit'; import { LoginRequest, LoginResponse } from '@interfaces'; import { loginApi } from '@api'; export const login = createAsyncThunk( 'auth/login', async (payload, { rejectWithValue }) => { try { return await loginApi(payload); } catch (error: any) { return rejectWithValue(error.message || 'Failed to login'); } }, ); export const logout = createAction('USER_LOGOUT');