From c7af6f9e9d3d7e0cf095eab709ff8f5223afda8a Mon Sep 17 00:00:00 2001
From: Damien <damien.burel@maarch.org>
Date: Fri, 29 Jan 2021 16:48:02 +0100
Subject: [PATCH] FEAT #16063 TIME 0:15 Positions with holes

---
 src/app/home/controllers/TileController.php | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/app/home/controllers/TileController.php b/src/app/home/controllers/TileController.php
index af5ad66298e..367093c6fd1 100644
--- a/src/app/home/controllers/TileController.php
+++ b/src/app/home/controllers/TileController.php
@@ -162,15 +162,13 @@ class TileController
         }
 
         foreach ($body['tiles'] as $key => $tile) {
-            if ($key != $tile['position']) {
-                TileModel::update([
-                    'set'   => [
-                        'position' => $key,
-                    ],
-                    'where' => ['id = ?'],
-                    'data'  => [$tile['id']]
-                ]);
-            }
+            TileModel::update([
+                'set'   => [
+                    'position' => $tile['position'],
+                ],
+                'where' => ['id = ?'],
+                'data'  => [$tile['id']]
+            ]);
         }
 
         return $response->withStatus(204);
-- 
GitLab