forked from mirrors/homebox
labels create and get
This commit is contained in:
parent
f956ec8eb2
commit
8ece3bd7bf
24 changed files with 850 additions and 132 deletions
|
@ -12,9 +12,18 @@
|
|||
|
||||
const preferences = useLocationViewPreferences();
|
||||
|
||||
const location = ref<Location | null>(null);
|
||||
const locationId = computed<string>(() => route.params.id as string);
|
||||
|
||||
const { data: location } = useAsyncData(locationId.value, async () => {
|
||||
const { data, error } = await api.locations.get(locationId.value);
|
||||
if (error) {
|
||||
toast.error('Failed to load location');
|
||||
navigateTo('/home');
|
||||
return;
|
||||
}
|
||||
return data;
|
||||
});
|
||||
|
||||
function maybeTimeAgo(date?: string): string {
|
||||
if (!date) {
|
||||
return '??';
|
||||
|
@ -41,17 +50,6 @@
|
|||
return dt;
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
const { data, error } = await api.locations.get(locationId.value);
|
||||
|
||||
if (error) {
|
||||
toast.error('Failed to load location');
|
||||
navigateTo('/home');
|
||||
return;
|
||||
}
|
||||
location.value = data;
|
||||
});
|
||||
|
||||
const { reveal } = useConfirm();
|
||||
|
||||
async function confirmDelete() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue