@medic/cht-datasource
    Preparing search index...

    Function update

    • Returns a function for updating a person from the given data context.

      Parameters

      Returns <T extends UpdatePersonInput>(updated: T) => Promise<T>

      a function for updating a person

        • <T extends UpdatePersonInput>(updated: T): Promise<T>
        • Updates an existing person to have the provided data.

          Type Parameters

          Parameters

          • updated: T

            the updated person data. The complete data for the person must be provided. Existing fields not included in the updated data will be removed from the person. If the provided parent lineage is hydrated (e.g. for a PersonWithLineage), the lineage will be properly dehydrated before being stored.

          Returns Promise<T>

          the updated person with the new _rev value

          InvalidArgumentError if _id is not provided

          ResourceNotFoundError if _id does not identify an existing person contact @throws InvalidArgumentError if _revis not provided or does not match the person's current_revvalue @throws InvalidArgumentError ifnameis not provided @throws InvalidArgumentError if any of the following read-only properties are changed:reported_date, parent, type, contact_type`

      Error if a data context is not provided