Error Querying createdAt Attribute in access control

default discord avatar
sandrowegmann
5 months ago
2

When trying to return a query constraint for the createdAt attribute, I get the following error.



Access control function:


 read: () => {
      return ({
        createdAt: {
          greater_than: new Date(new Date().getTime() - 1000 * 60 * 60)
        }
      })
    },

Error:


 {
            "name": "QueryError",
            "message": "The following path cannot be queried: createdAt",
            "data": [
                {
                    "path": "createdAt"
                }
            ]
        }

Is this expected behaviour?

  • default discord avatar
    evilted
    5 months ago

    Do not think so, upgraded from 1.6.28 to 1.7.2 and started seeing the same thing :/



    Same applies to

    updatedAt

    property

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.