Open Christian-Garrison opened 1 year ago
@runeb pinging for visibility
Same problem here 😕
@Christian-Garrison Just discovered that we need to create a Webhook in a legacy way. This is described on the readme, and this link helps.
@felipeorlando I do have the legacy webhook setup, by chance are you able to share your code files around this? "assuming you have it working"
@felipeorlando @Christian-Garrison If you had success with this please share the working code if possible :)
@ApinisMikelis @felipeorlando @Christian-Garrison I'm another in the line of people with this issue. Any tips for resolving?
I am also having this issue.
Hey yall,
I really don't remember what I was doing here... but here is the code I implemented to solve the problem:
https://gist.github.com/felipeorlando/17381f55a2e3b0e65ab64018caed4159#file-places-indexer-js
Again, as I mentioned, is required to create a Webhook in a legacy way. This is described on the readme of this (sanity-algolia) project. You can see how to do it on the "Migrating the legacy webhook behavior to GROQ-powered Webhooks" article.
Hey all,
Ran into this issue as well. If we look into the source code we can find the 'created' that the error is coming from
const { created = [], updated = [] } = body.ids
https://github.com/sanity-io/sanity-algolia/blob/b93dbde5795ef577c56828f90a7a3686070c570d/src/index.ts#L72C52-L72C52
From the request.body it expects the leading property to be .ids which you can define in your webhook GROQ. If you don't have this defined then body.ids is undefined and throws the error.
This is an example of the GROQ you should put in your webhook configurations. You may run into issues with created / deleted / updated values being [null] which will also throw an error in the package but haven't figured out that part yet.
Constants
Configurations
Async Serverless Functions "w/ Secret"