Fix enums not working in production environment

This commit is contained in:
2024-05-12 19:24:10 +02:00
parent f6b9c4ddf0
commit c91eca0239
3 changed files with 11 additions and 11 deletions
+4 -4
View File
@@ -13,16 +13,16 @@ function DrinkCard(arg:Arguments) {
var link = "/inventory/";
switch (arg.drink.type) {
case DrinkType.Beer:
case "Beer":
link += "beer/";
break;
case DrinkType.Wine:
case "Wine":
link += "wine/";
break;
case DrinkType.Soda:
case "Soda":
link += "soda/";
break;
case DrinkType.Cocktail:
case "Cocktail":
link += "cocktail/";
break;
}
+5 -5
View File
@@ -32,15 +32,15 @@ export function isDrinkWithStyle(drink:DrinkComposite) : drink is WineWithStyle
export function containerTypeToString(type: ContainerType){
switch(type){
case ContainerType.BeerBottle:
case "BeerBottle":
return "Beer";
case ContainerType.Can:
case "Can":
return "Can";
case ContainerType.Carton:
case "Carton":
return "Carton";
case ContainerType.PlasticBottle:
case "PlasticBottle":
return "PET";
case ContainerType.WineBottle:
case "WineBottle":
return "Wine";
}
}
+2 -2
View File
@@ -19,11 +19,11 @@ export async function loader({
let user = session.get("user");
// Admin
if(user.type == UserType.Admin){
if(user.type == "Admin"){
return redirect("/admin");
}
if(user.type == UserType.Scanner){
if(user.type == "Scanner"){
return redirect("/scan");
}
}