* Updating a task now sends only data that's actually needed (Fixes #7846) Updating a task with a huge history lead to 'request entity too large' errors since the client attempted to send all data associated with a task, regardless of whether that data could be changed or not. With this change, the post request is now omitting the following fields: challenge completed createdAt group history id reminders tags type updatedAt userId * Changes according to review (use _.omit)
This commit is contained in:
@@ -72,10 +72,16 @@ angular.module('habitrpg')
|
||||
};
|
||||
|
||||
function updateTask (taskId, taskDetails) {
|
||||
var taskDetailsToSend = _.omit(
|
||||
taskDetails,
|
||||
['challenge', 'completed', 'createdAt', 'group', 'history', 'id',
|
||||
'reminders', 'tags', 'type', 'updatedAt', 'userId']
|
||||
)
|
||||
|
||||
return $http({
|
||||
method: 'PUT',
|
||||
url: '/api/v3/tasks/' + taskId,
|
||||
data: taskDetails,
|
||||
data: taskDetailsToSend,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user