Kaynağa Gözat

Property Search Temp Fix - for Demo

master
George Williams 5 yıl önce
ebeveyn
işleme
dc8fa1256d

+ 19
- 0
UnivateProperties_API/Controllers/Properties/PropertyController.cs Dosyayı Görüntüle

@@ -84,6 +84,25 @@ namespace UnivateProperties_API.Controllers.Properties
84 84
             return new OkObjectResult(_Repo.GetDisplay(search));
85 85
         }
86 86
 
87
+        //Will need to come out. Post search not working......:(
88
+        [HttpGet("search/{userId}/{keyword}/{salesType}/{propertyUsageType}/{propertyType}/{province}/{city}/{suburb}")]
89
+        public IActionResult Search(int userId, string keyword, string salesType, string propertyUsageType, string propertyType, string province, string city, string suburb)
90
+        {
91
+            var search = new PropertySearch()
92
+            {
93
+                UserID = userId,
94
+                Keyword = keyword,
95
+                SalesType = salesType,
96
+                PropertyUsageType = propertyUsageType,
97
+                PropertyType = propertyType,
98
+                Province = province,
99
+                City = city,
100
+                Suburb = suburb
101
+            };
102
+
103
+            return new OkObjectResult(_Repo.GetDisplay(search));
104
+        }
105
+
87 106
         [HttpPost]
88 107
         public IActionResult Post([FromBody] Property property)
89 108
         {

+ 1
- 1
UnivateProperties_API/Repository/Properties/PropertyRepository.cs Dosyayı Görüntüle

@@ -252,7 +252,7 @@ namespace UnivateProperties_API.Repository.Properties
252 252
             });
253 253
             Save();
254 254
 
255
-            if (!string.IsNullOrEmpty(search.Keyword))
255
+            if (!string.IsNullOrEmpty(search.Keyword) && search.Keyword.ToUpper() != "ALL")
256 256
             {
257 257
                 string keyword = search.Keyword.ToLower();
258 258
 

Loading…
İptal
Kaydet