From 7ef0ce169de7442c6ef4192201a2e4ac09eb36ac Mon Sep 17 00:00:00 2001 From: Samantha Kellow Date: Sun, 20 Aug 2023 20:17:54 +0100 Subject: [PATCH] Fix generated title --- app/sos/page.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/sos/page.tsx b/app/sos/page.tsx index 731f1051f..35875df7f 100644 --- a/app/sos/page.tsx +++ b/app/sos/page.tsx @@ -5,7 +5,7 @@ import { Input } from "@/components/ui/input"; import { Combox } from "components/combox"; import { ProductSKUs } from "components/product/sku-generator"; import { collectionsSKUs, garmentHandleKeys } from "constants/sku"; -import { capitalizeFirstLetter, copyText, getKeyByValue } from "lib/helpers/actions"; +import { capitalizeFirstLetter, copyText } from "lib/helpers/actions"; import { useEffect, useState } from "react"; // type SKUSelectorState = { @@ -42,11 +42,7 @@ export default async function NewProductHelpPage() { const collectionOptions = optionsMapper(collectionsSKUs, collectionValues); const createTitle = () => { - let collectionMapper = getKeyByValue(collectionsSKUs, collection) - if (collectionMapper) collectionMapper = capitalizeFirstLetter(collectionMapper) - let garmentMapper = getKeyByValue(garmentHandleKeys, garment) - if (garmentMapper) garmentMapper = capitalizeFirstLetter(garmentMapper) - setTitle(`${collectionMapper}scape No.${number} ${garmentMapper}`) + setTitle(collection && garment && `${capitalizeFirstLetter(collection)}scape No.${number} ${garment}`) }