小编Tal*_*sar的帖子

Strapi v4 响应中没有关系字段

我遇到的问题是,在获取数据后,响应中不存在任何关系字段。当我查看具有关系的模式之一的模式时,我发现关系字段存在于属性对象中。但我的回复中仍然只得到非关系字段。

这是我的模式之一

{
  "kind": "collectionType",
  "collectionName": "activities",
  "info": {
    "singularName": "activity",
    "pluralName": "activities",
    "displayName": "activity"
  },
  "options": {
    "draftAndPublish": true
  },
  "pluginOptions": {},
  "attributes": {
    "name": {
      "type": "string"
    },
    "date": {
      "type": "date"
    },
    "subcategory": {
      "type": "relation",
      "relation": "oneToOne",
      "target": "api::subcategory.subcategory"
    },
    "members": {
      "type": "relation",
      "relation": "manyToMany",
      "target": "api::member.member",
      "inversedBy": "activities"
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

javascript strapi

10
推荐指数
1
解决办法
9455
查看次数

标签 统计

javascript ×1

strapi ×1