Skip to main content

Function: getFarm()

getFarm(fdm, principal_id, b_id_farm): Promise<any>

Defined in: fdm-core/src/farm.ts:78

Alpha

Retrieves a farm's details after verifying that the requesting principal has read access.

This function checks the principal's permissions before querying the database for the farm identified by the provided ID.

Parameters

fdm

any

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

principal_id

any

The identifier of the principal making the request.

b_id_farm

any

The unique identifier of the farm to retrieve.

Returns

Promise<any>

A Promise that resolves with the farm's details.

Throws

If permission checks fail or if an error occurs while retrieving the farm.