Skip to main content

removeOrganicCertification

@svenvw/fdm-source


@svenvw/fdm-source / fdm-core/src / removeOrganicCertification

Function: removeOrganicCertification()

removeOrganicCertification(fdm, principal_id, b_id_organic): Promise<void>

Defined in: fdm-core/src/organic.ts:165

Removes an organic certification.

This function checks if the principal has 'write' permission on the associated farm, then deletes the certification and its link to the farm.

Parameters

fdm

any

The FDM instance providing the connection to the database.

principal_id

any

The identifier of the principal removing the certification.

b_id_organic

any

The identifier of the organic certification to remove.

Returns

Promise<void>

Throws

If the principal does not have permission, the certification does not exist, or the database transaction fails.