Fix missing file URL for short-circuited _User in RestWrite.
This commit is contained in:
@@ -73,6 +73,8 @@ RestWrite.prototype.execute = function() {
|
||||
return this.validateAuthData();
|
||||
}).then(() => {
|
||||
return this.transformUser();
|
||||
}).then(() => {
|
||||
return this.expandFilesForExistingObjects();
|
||||
}).then(() => {
|
||||
return this.runDatabaseOperation();
|
||||
}).then(() => {
|
||||
@@ -704,6 +706,16 @@ RestWrite.prototype.handleInstallation = function() {
|
||||
return promise;
|
||||
};
|
||||
|
||||
// If we short-circuted the object response - then we need to make sure we expand all the files,
|
||||
// since this might not have a query, meaning it won't return the full result back.
|
||||
// TODO: (nlutsenko) This should die when we move to per-class based controllers on _Session/_User
|
||||
RestWrite.prototype.expandFilesForExistingObjects = function() {
|
||||
// Check whether we have a short-circuited response - only then run expansion.
|
||||
if (this.response && this.response.response) {
|
||||
this.config.filesController.expandFilesInObject(this.config, this.response.response);
|
||||
}
|
||||
};
|
||||
|
||||
RestWrite.prototype.runDatabaseOperation = function() {
|
||||
if (this.response) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user