问题描述
这是我的 Strapi 应用程序的目录结构(在一个特定模型中)
在访问 car-comapany.js 中的服务时出现错误。
这是我尝试访问的方式
module.exports = {
//DESCRIPTION : GET ALL THE CAR COMPANIES
find: async (ctx) => {
const file = "car-company"
const data = await strapi.services.car-company.getall(ctx); //this is the actual line where i need to access the particular method inside services folder.
if(data.statusCode==200){
ctx.send(
data.message.map(entity => sanitizeEntity(entity,{
model: strapi.models.car-company
})),data.statusCode)
}else{
ctx.send(
data,data.statusCode
)
}
},};
我得到的错误是 ReferenceError: company is not defined exactly at this line -->const data = await strapi.services.car-company.getall(ctx);
非常感谢任何帮助。谢谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)