This commit is contained in:
parent
9b4e12e3bc
commit
15e5ffb603
|
|
@ -121,11 +121,10 @@ export default async function Login({
|
|||
const workspace = homeWorkspace[0]; // Use the first (and only) row
|
||||
|
||||
if (!homeWorkspace || homeWorkspace.length === 0) {
|
||||
// Assert that homeWorkspaceError is of type PostgrestError or similar
|
||||
if (homeWorkspaceError) {
|
||||
// If homeWorkspaceError is not null, access its message
|
||||
throw new Error(homeWorkspaceError.message);
|
||||
throw new Error((homeWorkspaceError as PostgrestError).message || "No home workspace found for this user.");
|
||||
}
|
||||
// Fallback message if homeWorkspaceError is null
|
||||
throw new Error("No home workspace found for this user.");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue