Hello, you should pass an object to findOne and find, for find you passed the object correctly, but for findOne you are currently passing two parameters.
I had the same problem with findOne and ?_locale. I created controller logic that works for my project. This works if all localizations for the page share the same slug. I can also show how I did that if needed.
const { sanitizeEntity } = require('strapi-utils');
module.exports = {
async findOne(ctx) {
const { slug } = ctx.params;
const { _locale } = ctx.query;
// a request example would be 'http://localhost:1337/blog-posts/blog-post-1?_locale=fr-CA'
// the findOne by slug AND locale logic
if (_locale) {
const localeEntity = await strapi.services['blog-post'].find({ _locale, slug })
return sanitizeEntity(localeEntity, { model: strapi.models['blog-post'] });
};
// the findOne by slug logic
const entity = await strapi.services['blog-post'].findOne({ slug });
return sanitizeEntity(entity, { model: strapi.models['blog-post'] });
},
};