ソースを参照

feat: added basic product sorting -> by price

IceToast 3 年 前
コミット
cda13a2007
1 ファイル変更3 行追加6 行削除
  1. 3 6
      resources/views/servers/create.blade.php

+ 3 - 6
resources/views/servers/create.blade.php

@@ -302,11 +302,6 @@
 
                 },
 
-                debuggershit(e) {
-                    this
-
-                },
-
                 /**
                  * @description fetch all available locations based on the selected egg
                  * @note called whenever a server configuration is selected
@@ -354,7 +349,9 @@
                         .catch(console.error)
 
                     this.fetchedProducts = true;
-                    this.products = response.data
+                    // TODO: Sortable by user chosen property (cpu, ram, disk...)
+                    this.products = response.data.sort((p1, p2) => p1.price > p2.price && 1 || -1  )
+
 
                     this.loading = false;
                     this.updateSelectedObjects()