Fixed wrong overwrite of Additional Mission info
This commit is contained in:
@@ -355,9 +355,14 @@ export const MissionForm = () => {
|
||||
onChange={(e) => {
|
||||
form.setValue("hpgMissionString", e.target.value);
|
||||
const [name] = e.target.value.split(":");
|
||||
const allHpgMissionTypes = keywords?.map((k) => k.hpgMissionTypes).flat();
|
||||
console.log("Selected HPG Mission String:", name, allHpgMissionTypes);
|
||||
if (
|
||||
!form.watch("missionAdditionalInfo") ||
|
||||
form.watch("missionAdditionalInfo") === name
|
||||
allHpgMissionTypes?.find((t) => {
|
||||
const [hpgName] = t.split(":");
|
||||
return hpgName === form.watch("missionAdditionalInfo");
|
||||
})
|
||||
) {
|
||||
form.setValue("missionAdditionalInfo", name || "");
|
||||
}
|
||||
@@ -393,7 +398,7 @@ export const MissionForm = () => {
|
||||
/>
|
||||
{form.watch("type") === "sekundär" && (
|
||||
<input
|
||||
{...form.register("addressMissionLocation")}
|
||||
{...form.register("addressMissionDestination")}
|
||||
type="text"
|
||||
placeholder="Zielkrankenhaus"
|
||||
className="input input-primary input-bordered w-full"
|
||||
|
||||
Reference in New Issue
Block a user