|
|
@ -1,4 +1,5 @@
|
|
|
|
import { SetPagination, SetQueriesObject } from "@/utils/setQueriesObject";
|
|
|
|
import { SetPagination, SetQueriesObject } from "@/utils/setQueriesObject";
|
|
|
|
|
|
|
|
import { getJson as getJsonCountry } from "./countryResource";
|
|
|
|
export const getJson = (data) => {
|
|
|
|
export const getJson = (data) => {
|
|
|
|
let role_id = null;
|
|
|
|
let role_id = null;
|
|
|
|
data.roles.map(x => role_id = x.id);
|
|
|
|
data.roles.map(x => role_id = x.id);
|
|
|
@ -23,8 +24,12 @@ export const getJson = (data) => {
|
|
|
|
role: role,
|
|
|
|
role: role,
|
|
|
|
roles: data.roles,
|
|
|
|
roles: data.roles,
|
|
|
|
role_id: role_id,
|
|
|
|
role_id: role_id,
|
|
|
|
|
|
|
|
country: data.country ? getJsonCountry(data.country) : {},
|
|
|
|
created_courses_count: data.created_courses_count,
|
|
|
|
created_courses_count: data.created_courses_count,
|
|
|
|
joined_courses_count: data.joined_courses_count
|
|
|
|
joined_courses_count: data.joined_courses_count,
|
|
|
|
|
|
|
|
created_at: data.created_at,
|
|
|
|
|
|
|
|
// joined_date -> The correct format of created_at
|
|
|
|
|
|
|
|
joined_date: data.created_at?.slice(0, 10),
|
|
|
|
})
|
|
|
|
})
|
|
|
|
};
|
|
|
|
};
|
|
|
|
export const getArray = ({ data, meta }) => {
|
|
|
|
export const getArray = ({ data, meta }) => {
|
|
|
|