fetchOrganizations

suspend fun fetchOrganizations(sortAndFilter: ZyncOrganizationSortAndFilter, page: Int, pageSize: Int): GetOrganizationsResult

Fetch paginated list of organizations with sorting and filtering.

This method implements an offline-first pagination approach:

  • Page 1: Returns cached data immediately with optional background sync

  • Page 2+: Fetches from API only, no caching

Return

GetOrganizationsResult containing paginated organization list or error

Parameters

sortAndFilter

Sort and filter criteria for organizations

page

Page number (1-indexed)

pageSize

Number of organizations per page