mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-24 06:28:34 +01:00
Prevent self-referencing locations and items as parents (#773)
* prevent current location and descendants from being selected as parent * prevent an item from showing up in the parent items drop-down for itself * pass location object to filter function to allow for more flexible filtering * align exclude prop and fix type comparison, change item filter to array of ItemsObjects to allow for descendant filtering in future * fix linting prop reference
This commit is contained in:
@@ -58,6 +58,7 @@
|
||||
|
||||
type Props = {
|
||||
modelValue?: LocationSummary | null;
|
||||
currentLocation?: LocationSummary;
|
||||
};
|
||||
|
||||
const props = defineProps<Props>();
|
||||
@@ -66,7 +67,7 @@
|
||||
const open = ref(false);
|
||||
const search = ref("");
|
||||
const id = useId();
|
||||
const locations = useFlatLocations();
|
||||
const locations = useFlatLocations(props.currentLocation);
|
||||
const value = useVModel(props, "modelValue", emit);
|
||||
|
||||
function selectLocation(location: LocationSummary) {
|
||||
|
||||
Reference in New Issue
Block a user