Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ChangeRequestInterceptor

Hierarchy

  • ChangeRequestInterceptor

Index

Properties

Methods

Properties

Optional oneTime

oneTime: boolean

Methods

done

  • done(requests: Object[]): void
  • Last chance to change anything about the 'requests' array after it has been built with requests for all of the entities-to-be-saved.

    The 'requests' array is the same as 'saveBundle.entities' in many implementations

    This method can do anything to the array including add and remove requests. It's up to you to ensure that server will accept the requests array data as valid.

    Returned value is ignored.

    example

    this.done = function (requests) { // alter the array of requests representing the entire change-set // based on the saveContext and saveBundle };

    method

    done

    Parameters

    • requests: Object[]

      The adapter's array of request for this changeset.

    Returns void

getRequest

  • getRequest(request: any, entity: Entity, index: number): any
  • Prepare and return the save data for an entity change-set.

    The adapter calls this method for each entity in the change-set, after it has prepared a "change request" for that object.

    The method can do anything to the request but it must return a valid, non-null request.

    example

    this.getRequest = function (request, entity, index) { // alter the request that the adapter prepared for this entity // based on the entity, saveContext, and saveBundle // e.g., add a custom header or prune the originalValuesMap return request; };

    method

    getRequest

    Parameters

    • request: any

      The object representing the adapter's request to save this entity.

    • entity: Entity

      The entity-to-be-save as it is in cache

    • index: number

      The zero-based index of this entity in the change-set array

    Returns any

    The potentially revised request.

Generated using TypeDoc