API Profile:
Fix: - api create, get , edit Types Add: - Type-Profile ### No Issue
This commit is contained in:
@@ -4,5 +4,23 @@ export async function apiCreateProfile(data: any) {
|
||||
const response = await apiConfig.post(`/mobile/profile`, {
|
||||
data: data,
|
||||
});
|
||||
return response;
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function apiProfile({ id }: { id: string }) {
|
||||
const response = await apiConfig.get(`/mobile/profile/${id}`);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function apiUpdateProfile({
|
||||
id,
|
||||
data,
|
||||
}: {
|
||||
id: string;
|
||||
data: any;
|
||||
}) {
|
||||
const response = await apiConfig.put(`/mobile/profile/${id}`, {
|
||||
data: data,
|
||||
});
|
||||
return response.data;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { apiConfig } from "../api-config";
|
||||
|
||||
|
||||
export async function apiUser(id: string) {
|
||||
const response = await apiConfig.get(`/user/${id}`);
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ export const apiConfig: AxiosInstance = axios.create({
|
||||
|
||||
apiConfig.interceptors.request.use(
|
||||
async (config) => {
|
||||
console.log("API_BASE_URL >>", API_BASE_URL);
|
||||
const token = await AsyncStorage.getItem("authToken");
|
||||
if (token) {
|
||||
// config.timeout = 10000;
|
||||
|
||||
Reference in New Issue
Block a user