Class: patch

Adaptor.patch(resourceType, path, data, optionsopt, callbackopt) → {Operation}

new patch(resourceType, path, data, optionsopt, callbackopt) → {Operation}

Patch a record. A generic helper function to send partial updates on one or more object properties. - You are not required to send the full body of object properties. - This is useful for cases where you don't want or need to update all properties on a object.
Parameters:
Name Type Attributes Description
resourceType string The type of resource to be updated. E.g. `dataElements`, `organisationUnits`, etc.
path string The `id` or `path` to the `object` to be updated. E.g. `FTRrcoaog83` or `FTRrcoaog83/{collection-name}/{object-id}`
data Object Data to update. Include only the fields you want to update. E.g. `{name: "New Name"}`
options Object <optional>
Optional configuration, including params for the update ({preheatCache: true, strategy: 'UPDATE', mergeMode: 'REPLACE'}). Defaults to `{operationName: 'patch', apiVersion: state.configuration.apiVersion, responseType: 'json'}`
callback function <optional>
Optional callback to handle the response
Source:
Returns:
Type
Operation
Example

a dataElement

patch('dataElements', 'FTRrcoaog83', { name: 'New Name' });