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

    Function update

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

      Parameters

      Returns <T extends Place.v1.Place | PlaceWithLineage>(
          updated: UpdatePlaceInput<T>,
      ) => Promise<T>

      a function for updating a place

        • <T extends Place.v1.Place | PlaceWithLineage>(
              updated: UpdatePlaceInput<T>,
          ): Promise<T>
        • Updates an existing place to have the provided data.

          Type Parameters

          Parameters

          • updated: UpdatePlaceInput<T>

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

          Returns Promise<T>

          the updated place with the new _rev value

          InvalidArgumentError if _id is not provided

          ResourceNotFoundError if _id does not identify an existing place contact

          InvalidArgumentError if _rev is not provided or does not match the place's current _rev value

          InvalidArgumentError if name is not provided

          InvalidArgumentError if the provided contact is not the identifier of a valid person contact

          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