import axios from 'axios'
import { IServicesSchema } from '@/types/IDB'

const ACTION_NAME = 'services'

export default async function loadAllServices()
{
    let { data } = await axios.get(`/api/user/actions/${ACTION_NAME}?type=page&page=1`)
    let docs : IServicesSchema[] = data.data.docs;
    // Filter only active services
    return docs.filter(service => service.status === 'active');
}