#3624·feathers

`context.result` 类型太宽

作者: AshotN创建于 2025年10月20日更新于 2025年10月20日
typescript
// 主数据模型方案
export const companySchema = Type.Object(
  {
    id: Type.Number()
  },
  { $id: 'Company', additionalProperties: false }
)

// 创建新条目的方案
export const companyDataSchema = Type.Object(
  {
    id: Type.Number()
  },
  {
    $id: 'CompanyData',
    additionalProperties: false
  }
)
typescript
create: [
        async (context, next) => {
          const beforeResult = context.result
      
          await next()

          const afterResult = context.result
        }
      ]

beforeResultafterResult 的类型都返回了

内容来源: feathersjs/feathers