Allow seed command with argument

This commit is contained in:
Kalle (Sendou) 2022-01-20 08:50:00 +02:00
parent 4ce68fc758
commit 2a2c3fe377

View File

@ -13,20 +13,23 @@ export function SearchInputDev() {
const handleEnter = () => {
const [action, value] = inputValue.split(":");
if (!action || !value) return;
if (!action) return;
let fetchUrl = "";
switch (action) {
case "liu": {
if (!value) return;
fetchUrl = `/mock-auth?username=${encodeURIComponent(value)}`;
break;
}
case "lit": {
if (!value) return;
fetchUrl = `/mock-auth?team=${encodeURIComponent(value)}`;
break;
}
case "seed": {
fetchUrl = `/seed?variation=${encodeURIComponent(value)}`;
if (!value) fetchUrl = "/seed";
else fetchUrl = `/seed?variation=${encodeURIComponent(value)}`;
break;
}
default: {