upd: login
Deskripsi: - update axios api check phone number - modal loading - fungsi random number 4 digit No Issues
This commit is contained in:
35
lib/api.ts
Normal file
35
lib/api.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import axios from 'axios';
|
||||
|
||||
const api = axios.create({
|
||||
baseURL: 'http://10.0.2.2:3000/api',
|
||||
});
|
||||
|
||||
export const apiCheckPhoneLogin = async (body: { phone: string }) => {
|
||||
const response = await api.post('/auth/login', body)
|
||||
return response.data;
|
||||
}
|
||||
|
||||
// export const getEntities = async () => {
|
||||
// const response = await axios.get('https://stg-darmasaba.wibudev.com/api/version-app');
|
||||
// return response.data;
|
||||
// };
|
||||
|
||||
// export const createEntity = async (newEntity: any) => {
|
||||
// const response = await api.post('/entities', newEntity);
|
||||
// return response.data;
|
||||
// };
|
||||
|
||||
// export const updateEntityById = async (id: any, updatedEntity: any) => {
|
||||
// const response = await api.put(`/entities/${id}`, updatedEntity);
|
||||
// return response.data;
|
||||
// };
|
||||
|
||||
// export const deleteEntityById = async (id: any) => {
|
||||
// const response = await api.delete(`/entities/${id}`);
|
||||
// return response.data;
|
||||
// };
|
||||
|
||||
// export const checkAccount = async (newEntity: { phone: string }) => {
|
||||
// const response = await api.post('/auth/login', newEntity);
|
||||
// return response.data;
|
||||
// };
|
||||
Reference in New Issue
Block a user