Skip to content

Instantly share code, notes, and snippets.

@derrickmehaffy
Created October 22, 2021 17:30
Show Gist options
  • Select an option

  • Save derrickmehaffy/5aa49b44ae412c1b050df6baefed27a9 to your computer and use it in GitHub Desktop.

Select an option

Save derrickmehaffy/5aa49b44ae412c1b050df6baefed27a9 to your computer and use it in GitHub Desktop.
customerQuery
const qs = require("qs");
// This is for /topics
// const query = {
// _where: {
// _or: [
// {
// "genericAnswer.lifecycleStatus_in": ["waitingForValidation"],
// },
// {
// _or: [
// {
// "genericAnswer.answerDraft.lifecycleStatus_in": [
// "waitingForValidation",
// ],
// },
// { "genericAnswer.answerDraft_null": true },
// ],
// },
// ],
// },
// };
// This is for /answers
const query = {
_where: {
_or: [
{
"lifecycleStatus_in": ["waitingForValidation"] // how to not care if answerDrafts is null or not (relational_null: true). I believe this is broken in v3: https://github.com/strapi/strapi/issues/5414
},
{
"answerDraft.lifecycleStatus_in": ["waitingForValidation"]
}
]
}
}
qs.stringify(query, { encode: false });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment