Skip to main content

getEnabledFertilizerCataloguesForFarms

@nmi-agro/fdm-source


@nmi-agro/fdm-source / fdm-core/src / getEnabledFertilizerCataloguesForFarms

Function: getEnabledFertilizerCataloguesForFarms()

getEnabledFertilizerCataloguesForFarms(fdm, principal_id, farmIds): Promise<Record<string, string[]>>

Defined in: fdm-core/src/catalogues.ts:112

Gets all enabled fertilizer catalogues for multiple farms.

Parameters

fdm

PgDatabase

The FDM instance providing the connection to the database. The instance can be created with createFdmServer.

principal_id

any

The ID of the principal making the request.

farmIds

any[]

The IDs of the farms.

Returns

Promise<Record<string, string[]>>

A Promise that resolves to a record mapping each farm ID to an array of its enabled fertilizer catalogue sources.

Throws

If retrieving the catalogues fails.