diff --git a/GrossesMitaines/GrossesMitainesAPI/Controllers/SearchController.cs b/GrossesMitaines/GrossesMitainesAPI/Controllers/SearchController.cs index 1ac8c5c..a40b7a4 100644 --- a/GrossesMitaines/GrossesMitainesAPI/Controllers/SearchController.cs +++ b/GrossesMitaines/GrossesMitainesAPI/Controllers/SearchController.cs @@ -45,7 +45,6 @@ public class SearchController : Controller { string sTitle = prod.Title.Replace(".", " ").Replace(",", " ").ToLower(), sCat = prod.Category.Replace(".", " ").Replace(",", " ").ToLower(), sDesc = prod.Description.Replace(".", " ").Replace(",", " ").ToLower(); - if (sTitle.StartsWith(query)) products.Add(prod); else if (sTitle.Contains(" " + query + " ")) diff --git a/GrossesMitaines/grosses-mitaines-ui/src/components/SimpleItem.js b/GrossesMitaines/grosses-mitaines-ui/src/components/SimpleItem.js index 5dd1ece..807436d 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/components/SimpleItem.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/components/SimpleItem.js @@ -1,6 +1,29 @@ import { FaTimes } from 'react-icons/fa' import { FaTools } from 'react-icons/fa' +function renderStatus(statusCode) { + if (statusCode !== undefined) { + + switch (statusCode) { + case 0: + return ("Disponible"); + case 1: + return ("En commande"); + case 2: + return ("Indisponible"); + case 3: + return ("Liquidation"); + case 4: + return ("Promotion"); + case 5: + return ("Discontinué"); + default: + return (<>); + } + } + +} + const SimpleItem = ({ item, onDelete, onModify }) => { return (
@@ -13,7 +36,7 @@ const SimpleItem = ({ item, onDelete, onModify }) => { onClick={() => onDelete(item.id)} />
-

Categoie: {item.category}, Prix: {item.price}, Promo: {item.promoPrice}, Quantité: {item.quantity}

+

Categoie: {item.category}, Prix: {item.price}, Promo: {item.promoPrice}, Quantité: {item.quantity}, Disponibilité: {renderStatus(item.status)}

Description: {item.description}

) diff --git a/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css b/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css index 5067a8c..3b7e18c 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css +++ b/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css @@ -436,6 +436,7 @@ html { display: inline-block; height: auto; width: 97.5%; + padding: 1.25%; }