Add basic services; Base layout

This commit is contained in:
Aslan 2026-01-01 17:21:56 +01:00
parent be6467cd2c
commit ef526cd2db
30 changed files with 291 additions and 34 deletions

26
src/services/auth/auth.ts Normal file
View file

@ -0,0 +1,26 @@
import { fetchLoginApi, fetchRefreshApi } from "../../api/auth";
import { AuthActionTypes } from "../../store/auth";
import { dispatch } from "../../store/state";
const fetchLogin = async (username: string, password: string) => {
const data = await fetchLoginApi({
username: username,
password: password,
});
dispatch({
type: AuthActionTypes.FETCH_LOGIN_FINISH,
payload: data,
});
};
const fetchRefresh = async () => {
const data = await fetchRefreshApi();
dispatch({
type: AuthActionTypes.FETCH_REFRESH_FINISH,
payload: data,
});
};
export { fetchLogin, fetchRefresh };

View file

@ -0,0 +1 @@
export * from "./auth";