Requesting update state from published to draft

Hi! Did you manage to work this out - is it even possible? I want to make this ops as bulk but can not find a way via API also.

EDIT:
Now it works for me - my issue was that I tried to update “published_at” and is should have been “publishedAt” :slight_smile: Docs could be a bit more clearer here!

const query = {
  where: {
    id: ids[0]
  },
  data: {
    publishedAt: (operation === "publish") ? new Date().toISOString() : null
  }
}

await strapi.db.query('api::product.product').update(query)
1 Like