mediahub-fe/service/auth.ts

44 lines
985 B
TypeScript
Raw Normal View History

2024-12-26 11:29:22 +00:00
import {
getAPI,
getAPIInterceptor,
postAPI,
postAPIInterceptor,
postAPIWithJson,
} from "../config/api";
import { getAPIDummy } from "./http-config/axiosCustom";
import {
httpGetInterceptorWithToken,
httpPostInterceptor,
} from "./http-config/http-interceptor-service";
export async function setLogin(data: any) {
const pathUrl = "signin";
return postAPI(pathUrl, data);
}
export async function getProfile(token: any) {
const url = "users/info";
return getAPI(url, token);
}
2024-12-26 11:29:22 +00:00
export async function getInfoProfile() {
const url = "users/info";
return getAPIInterceptor(url);
}
export async function setupPassword(data: any) {
const url = "setup-password";
return postAPIInterceptor(url, data);
}
export async function saveUser(data: any) {
const url = "users/save";
return postAPIInterceptor(url, data);
}
export async function userInfo(token: any) {
const pathUrl = `users/info`;
return await httpGetInterceptorWithToken(pathUrl, token);
}