from intranet.search.core import storages
from intranet.search.api.api1.forms import ApiOrganizationForm
from .base import FormApiView


class ServicesApiView(FormApiView):
    """ Получение списка сервисов
    """
    form_class = ApiOrganizationForm

    def get_response_data(self, form):
        repository = storages.StorageRepository()
        return repository['organization'].get_services(form.organization.data)
