mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-10-30 21:52:00 +01:00
fixes #2158 refactor user data assignment
...with spread operator for cleaner code. This change also allows for compatibility with additional fields that may be returned by the API, such as those added by plugins, ensuring all elements are captured without explicitly defining each one.
This commit is contained in:
1 parent
6e964af343
commit
1d087ebefe
1 file changed
+1
-12
@@ -1944,18 +1944,7 @@ function update_user_info() {
|
||||
if (data.stat === 'ok') {
|
||||
let result_user = data.result.users[0];
|
||||
if (last_user_index != -1) {
|
||||
current_users[last_user_index].email = result_user.email;
|
||||
current_users[last_user_index].enabled_high = result_user.enabled_high;
|
||||
current_users[last_user_index].expand = result_user.expand;
|
||||
current_users[last_user_index].groups = result_user.groups;
|
||||
current_users[last_user_index].language = result_user.language;
|
||||
current_users[last_user_index].level = result_user.level;
|
||||
current_users[last_user_index].nb_image_page = result_user.nb_image_page;
|
||||
current_users[last_user_index].recent_period = result_user.recent_period;
|
||||
current_users[last_user_index].show_nb_comments = result_user.show_nb_comments;
|
||||
current_users[last_user_index].show_nb_hits = result_user.show_nb_hits;
|
||||
current_users[last_user_index].status = result_user.status;
|
||||
current_users[last_user_index].theme = result_user.theme;
|
||||
current_users[last_user_index] = {...current_users[last_user_index], ...result_user};
|
||||
fill_container_user_info($('#user-table-content .user-container').eq(last_user_index), last_user_index);
|
||||
}
|
||||
$("#UserList .update-user-success").fadeIn().delay(1500).fadeOut(2500);
|
||||
|
||||
Reference in new issue
Block a user