import orderBy from 'lodash/orderBy'; import { ITeam } from './team.types'; import { directus } from '@/plugins/axios/'; import { IParamsDirectus } from '../baseTypes'; import { POST_STATUS } from '@/utils/constants'; const postPreviewFields = 'image,imageFile,linkedin,name,position,order'; export async function getTeam(): Promise { const params: IParamsDirectus = { sort: 'date_created', fields: postPreviewFields, filter: { status: POST_STATUS.published, }, }; const { data: team } = await directus.get('teams', { params, }); return orderBy(team.data, 'order'); } export const TeamGateway = { getTeam, };