fix(dimentorin): unwrap paginated response + local dev API URL
This commit is contained in:
@@ -17,7 +17,7 @@ export const getMentors = async (
|
|||||||
url: '/dimentorin/mentors/public',
|
url: '/dimentorin/mentors/public',
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
return data;
|
return data.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getMentorDetail = async (id: string): Promise<TMentorDetail> => {
|
export const getMentorDetail = async (id: string): Promise<TMentorDetail> => {
|
||||||
@@ -25,7 +25,7 @@ export const getMentorDetail = async (id: string): Promise<TMentorDetail> => {
|
|||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: `/dimentorin/mentors/public/${id}`,
|
url: `/dimentorin/mentors/public/${id}`,
|
||||||
});
|
});
|
||||||
return data;
|
return data.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getMentorMe = async (): Promise<TMentorDetail> => {
|
export const getMentorMe = async (): Promise<TMentorDetail> => {
|
||||||
@@ -33,7 +33,7 @@ export const getMentorMe = async (): Promise<TMentorDetail> => {
|
|||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: '/dimentorin/mentors/me',
|
url: '/dimentorin/mentors/me',
|
||||||
});
|
});
|
||||||
return data;
|
return data.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getMentorMeStatus = async (): Promise<{ status: string }> => {
|
export const getMentorMeStatus = async (): Promise<{ status: string }> => {
|
||||||
@@ -41,7 +41,7 @@ export const getMentorMeStatus = async (): Promise<{ status: string }> => {
|
|||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: '/dimentorin/mentors/me/status',
|
url: '/dimentorin/mentors/me/status',
|
||||||
});
|
});
|
||||||
return data;
|
return data.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getMentorAvailability = async (
|
export const getMentorAvailability = async (
|
||||||
@@ -51,7 +51,7 @@ export const getMentorAvailability = async (
|
|||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: `/dimentorin/mentors/${id}/availability`,
|
url: `/dimentorin/mentors/${id}/availability`,
|
||||||
});
|
});
|
||||||
return data;
|
return data.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getMentorSessions = async (
|
export const getMentorSessions = async (
|
||||||
@@ -61,7 +61,7 @@ export const getMentorSessions = async (
|
|||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: `/dimentorin/mentors/${id}/sessions`,
|
url: `/dimentorin/mentors/${id}/sessions`,
|
||||||
});
|
});
|
||||||
return data;
|
return data.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getMySessions = async (): Promise<TSessionListResponse> => {
|
export const getMySessions = async (): Promise<TSessionListResponse> => {
|
||||||
@@ -69,7 +69,7 @@ export const getMySessions = async (): Promise<TSessionListResponse> => {
|
|||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: '/dimentorin/sessions/me',
|
url: '/dimentorin/sessions/me',
|
||||||
});
|
});
|
||||||
return data;
|
return data.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const postBookSession = async (
|
export const postBookSession = async (
|
||||||
|
|||||||
Reference in New Issue
Block a user