obj/src/persistence/IdentifiableMemoryPersistence.js
/**
     * Updates only few selected fields in a data item.
     *
     * @param correlationId    (optional) transaction id to trace execution through call chain.
     * @param id                an id of data item to be updated.
     * @param data              a map with fields to be updated.
     * @returns                 the updated data item.
     */
Updates only few selected fields in a data item.
@param correlationId    (optional) transaction id to trace execution through call chain.
@param id                an id of data item to be updated.
@param data              a map with fields to be updated.
@returns                 the updated data item.
Updates only few selected fields in a data item . @param correlationId ( optional ) transaction id to trace execution through call chain . @param id an id of data item to be updated . @param data a map with fields to be updated . @returns the updated data item .
updatePartially(correlationId, id, data) {
        return __awaiter(this, void 0, void 0, function* () {
            let index = this._items.map(item => item.id).indexOf(id);
            if (index < 0) {
                this._logger.trace(correlationId, "Item %s was not found", id);
                return null;
            }
            let item = this._items[index];
            item = Object.assign(item, data.getAsObject());
            this._items[index] = item;
            this._logger.trace(correlationId, "Partially updated item %s", id);
            yield this.save(correlationId);
            return item;
        });
    }
updatePartially ( correlationId , id , data ) { return __awaiter ( this , void 0 , void 0 , function * ( ) { let index = this . _items . map ( item => item . id ) . indexOf ( id ) ; if ( index < 0 ) { this . _logger . trace ( correlationId , "Item %s was not found" , id ) ; return null ; } let item = this . _items [ index ] ; item = Object . assign ( item , data . getAsObject ( ) ) ; this . _items [ index ] = item ; this . _logger . trace ( correlationId , "Partially updated item %s" , id ) ; yield this . save ( correlationId ) ; return item ; } ) ; }
Updates only few selected fields in a data item.
Updates only few selected fields in a data item .