API response for Custom Type not returning Slice data

Hi,

I am reaching out to you because, recently I have upgraded my slicemachine v0.4.2 -> v0.5.0. And synced all my slices data.
Suddenly on prismic.io dashboard in my page(custom type) all the slices information vanished.
I managed to debug the issue and found that the API is returning me empty slice array in response for all the pages which I had created earlier. I added a new page called 'variations' with one slice. The information for this is retrieved in the API data(attached screenshot).


I am able to locate the pages correctly with its content from the slices we created on vercel.app

On local I am not able to preview the content. The search api is throwing following error:

Failed to load resource: Origin http://localhost:3000 is not allowed by Access-Control-Allow-Origin. Status code: 400.

Can you please help me in fixing this. Thank you

Hello @geniebooks.com, can you check in the history of the document if there was content before.
Content exists in your API unless you delete it manually.

Hi @Pau,
Thanks for the reply.
I checked the history of the document and tried to restore it. When I hit restore nothing loads on the screen. Sometimes its giving 404 response as well

We never deleted the data manually.
I upgraded the slice-machine-ui from v0.4.2 -> v0.5.0, as it was a minor update, I was not hesitant to update it.
After updating it I saw this new sync feature which was a part of the update, and the button "Push Slice to Prismic" was enabled, So, I clicked on it, it showed me some updating text message on screen. It took some time and all my slices were synced again as per the slice-machine preview.

Once this was done, I went to Prismic and checked my pages preview:

  1. the local server stopped working, with the network error which I have shared in previous post.
  2. all my data for the slices and all the slices which were included in the custom type(page) were gone, it was empty.
  3. My vercel.app link is still live and shows all the content properly, LINK
    the screen is stuck in loading and in the network response I am getting 404.

Is there any other way to restore it?

Hi @Pau,
Whenever I try to create a new page, I am getting the following network error

Can you try and log the content in the console?
400 error indicates that there's something wrong with the request you're making.