Apply code review
This commit is contained in:
Родитель
23f1946df8
Коммит
1fbe3bc18a
|
@ -586,7 +586,11 @@ TableService.prototype.insertEntity = function (tableName, entityDescriptor, opt
|
|||
responseObject.insertResponse = null;
|
||||
if (!responseObject.error) {
|
||||
responseObject.insertResponse = entityResult.parse(responseObject.response.body.entry);
|
||||
responseObject.insertResponse.etag = responseObject.response.headers[HeaderConstants.ETAG.toLowerCase()];
|
||||
if (!responseObject.insertResponse._) {
|
||||
responseObject.insertResponse._ = {};
|
||||
}
|
||||
|
||||
responseObject.insertResponse._.etag = responseObject.response.headers[HeaderConstants.ETAG.toLowerCase()];
|
||||
}
|
||||
|
||||
var finalCallback = function (returnObject) {
|
||||
|
@ -641,7 +645,12 @@ TableService.prototype.insertOrReplaceEntity = function (tableName, entityDescri
|
|||
var processResponseCallback = function (responseObject, next) {
|
||||
responseObject.insertResponse = null;
|
||||
if (!responseObject.error) {
|
||||
entityDescriptor.etag = responseObject.response.headers[HeaderConstants.ETAG.toLowerCase()];
|
||||
if (!entityDescriptor._) {
|
||||
entityDescriptor._ = {};
|
||||
}
|
||||
|
||||
entityDescriptor._.etag = responseObject.response.headers[HeaderConstants.ETAG.toLowerCase()];
|
||||
|
||||
responseObject.entityResponse = entityDescriptor;
|
||||
}
|
||||
|
||||
|
@ -698,7 +707,11 @@ TableService.prototype.updateEntity = function (table, entityDescriptor, options
|
|||
var processResponseCallback = function (responseObject, next) {
|
||||
responseObject.entityResponse = null;
|
||||
if (!responseObject.error) {
|
||||
entityDescriptor.etag = responseObject.response.headers[HeaderConstants.ETAG.toLowerCase()];
|
||||
if (!entityDescriptor._) {
|
||||
entityDescriptor._ = {};
|
||||
}
|
||||
entityDescriptor._.etag = responseObject.response.headers[HeaderConstants.ETAG.toLowerCase()];
|
||||
|
||||
responseObject.entityResponse = entityDescriptor;
|
||||
}
|
||||
|
||||
|
@ -755,7 +768,11 @@ TableService.prototype.mergeEntity = function (tableName, entityDescriptor, opti
|
|||
var processResponseCallback = function (responseObject, next) {
|
||||
responseObject.entityResponse = null;
|
||||
if (!responseObject.error) {
|
||||
entityDescriptor.etag = responseObject.response.headers[HeaderConstants.ETAG.toLowerCase()];
|
||||
if (!entityDescriptor._) {
|
||||
entityDescriptor._ = {};
|
||||
}
|
||||
|
||||
entityDescriptor._.etag = responseObject.response.headers[HeaderConstants.ETAG.toLowerCase()];
|
||||
responseObject.entityResponse = entityDescriptor;
|
||||
}
|
||||
|
||||
|
@ -810,7 +827,11 @@ TableService.prototype.insertOrMergeEntity = function (tableName, entityDescript
|
|||
var processResponseCallback = function (responseObject, next) {
|
||||
responseObject.entityResponse = null;
|
||||
if (!responseObject.error) {
|
||||
entityDescriptor.etag = responseObject.response.headers[HeaderConstants.ETAG.toLowerCase()];
|
||||
if (!entityDescriptor._) {
|
||||
entityDescriptor._ = {};
|
||||
}
|
||||
|
||||
entityDescriptor._.etag = responseObject.response.headers[HeaderConstants.ETAG.toLowerCase()];
|
||||
responseObject.entityResponse = entityDescriptor;
|
||||
}
|
||||
|
||||
|
|
|
@ -468,7 +468,7 @@ suite('tableservice-tests', function () {
|
|||
assert.notEqual(insertEntity, null);
|
||||
assert.ok(insertResponse.isSuccessful);
|
||||
assert.equal(insertResponse.statusCode, HttpConstants.HttpResponseCodes.Created);
|
||||
var originalEtag = newEntity1['etag'];
|
||||
var originalEtag = newEntity1._.etag;
|
||||
|
||||
newEntity1['otherfield'] = newField;
|
||||
|
||||
|
@ -477,7 +477,7 @@ suite('tableservice-tests', function () {
|
|||
assert.notEqual(updateEntity2, null);
|
||||
assert.ok(updateResponse2.isSuccessful);
|
||||
assert.equal(updateResponse2.statusCode, HttpConstants.HttpResponseCodes.NoContent);
|
||||
assert.notEqual(newEntity1.etag, originalEtag);
|
||||
assert.notEqual(newEntity1._.etag, originalEtag);
|
||||
|
||||
done();
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче