How can I filter for an enum payload field value in the frontend-config.js?
App Development3 posts238 views3 likesLast activity Oct 2021
GY
gyorgybalazsiOP
Oct 2021This works, where the field value is simple text:
type: "contracts",
filter: [
{
field: "argument.cmrId",
value: "LP-HU000002"
}
],
I have a status field on the contract, which is an enum:
data Status = DRAFT | ISSUED | CANCELLED | (...) deriving( Eq, Show)
I couldn’t find out how to specify the field value. This doesn’t seem to work:
type: "contracts",
filter: [
{
field: "argument.status",
value: "DRAFT"
}
],
CO
cocreature
Oct 2021You need to match on the constructor similarly to variants:
{
field: "argument.status.__constructor",
value: "DRAFT"
}
GY
gyorgybalazsi
Oct 2021Awesome, thank you!