Skip to content

Commit

Permalink
Keep equipment type from list in new equipment select (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
KordonDev authored Jan 14, 2024
1 parent c7afea8 commit a243b85
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions frontend/src/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export const routes = {
link: "/users",
},
EquipmentAdd: {
path: "/equipment/add",
link: "/equipment/add",
path: "/equipment/add/:type",
link: "/equipment/add/",
},
EquipmentType: {
path: "/equipment/type/:type",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/equipment/EquipmentByType.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<Navigation />
<h1>Ausrüstung vom Typ {translateEquipmentType(params.type)}</h1>

<a href={routes.EquipmentAdd.link} use:link>Neue Ausrüstung anlegen</a>
<a href={`${routes.EquipmentAdd.link}${currentType}`} use:link>Neue Ausrüstung anlegen</a>

<Label class="mb-4">
<div class="mb-2">Art</div>
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/views/equipment/NewEquipment.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import { getRegistrationCode } from "../registrationCode/registrationCode.service"
import Navigation from "../../components/Navigation/Navigation.svelte";
export let params = { type: undefined };
let equipment: Equipment = {
registrationCode: "",
type: EquipmentType.Jacket,
Expand All @@ -21,8 +23,10 @@
};
let loading = false;
onMount(() => {
if (params.type !== undefined) {
equipment.type = params.type;
}
getRegistrationCode()
.then(rc => {
if (equipment.registrationCode === "") {
Expand Down

0 comments on commit a243b85

Please sign in to comment.