Fix bug
Some checks failed
Build BAB Application Deployment Artifact / build (push) Failing after 2m6s
Some checks failed
Build BAB Application Deployment Artifact / build (push) Failing after 2m6s
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user