Skip to content

Commit 92c6d2a

Browse files
committed
🐞 fix: enum structure detection
1 parent a562d0a commit 92c6d2a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/enum.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,16 @@ export const createEnumImplementer = <
9797
let enumValues: any[] | undefined;
9898

9999
if (tsName) {
100-
const schemaEnum = db._.schema![tsName as string];
100+
const schemaEnum = db._.fullSchema![tsName as string];
101101

102102
enumSchemaName = tsName.toString();
103103

104104
const enumCol = Object.values(db._.schema!)
105105
.filter((s) => typeof s === "object")
106106
.map((s) => Object.values(s.columns))
107107
.flat(2)
108-
.find((s: any) => s.config?.enum === schemaEnum);
108+
.filter(isEnumSchema)
109+
.find((e: any) => e.config.enum === schemaEnum);
109110

110111
if (!enumCol) {
111112
throw new RumbleError(`Could not find applied enum column for ${tsName.toString()}.

0 commit comments

Comments
 (0)