diff --git a/public/client.js b/public/client.js index 808960f..a1bfead 100644 --- a/public/client.js +++ b/public/client.js @@ -49,12 +49,15 @@ widget.searchParams.append("drugs.message", options.drugs.message); } - if (Array.isArray(options.drugs)) { - if (options.drugs.length > 1) { + if (Array.isArray(options.drugs.selected)) { + if (options.drugs.selected.length > 1) { throw new Error("we only support one drug at the moment"); } - widget.searchParams.append("drugs.selected", options.drugs.join(",")); + widget.searchParams.append( + "drugs.selected", + options.drugs.selected.join(",") + ); } } diff --git a/src/components/Prescription.svelte b/src/components/Prescription.svelte index 2801485..70478b7 100644 --- a/src/components/Prescription.svelte +++ b/src/components/Prescription.svelte @@ -31,8 +31,6 @@ let drugs: Drug[] = []; let dosages: Dosage[] = []; - console.log(preferredDrugs.message); - let selectedDrugId: string = preferredDrugs?.selected[0] ?? null; let selectedDosageConcentration: string; let prescriptionDirections: string;