Fix bug
Some checks failed
Build BAB Application Deployment Artifact / build (push) Failing after 2m6s

This commit is contained in:
2024-05-25 08:34:25 -04:00
parent 9f398e5509
commit 59d2729719
4 changed files with 121 additions and 21 deletions

View File

@@ -39,8 +39,9 @@ export const useBoatStore = defineStore('boat', () => {
}
}
const getBoatById = (id: string): Boat | null => {
return boats.value.find((b) => b.$id === id) || null;
const getBoatById = (id: string | null | undefined): Boat | null => {
if (!id) return null;
return boats.value?.find((b) => b.$id === id) || null;
};
return { boats, fetchBoats, getBoatById };