Compare enums in select

I want to compare enum from my offer schema with query parameter (that is basically string).

export const offerType = pgEnum('type', ['SEARCH']);

query used in where statement: eq(offers.type, query.type)

error from nestjs server:
[Nest] 6660  - 06. 07. 2023, 19:22:57   ERROR [ExceptionsHandler] invalid input syntax for type integer: "SEARCH"
error: invalid input syntax for type integer: "SEARCH"


How am I supposed to check equality of enum and string in my select query?
Was this page helpful?