nestjsx / crud

NestJs CRUD for RESTful APIs
https://github.com/nestjsx/crud/wiki
MIT License
4.04k stars 533 forks source link

swagger.helper.js can't read HttpStatus #714

Open guiqide opened 3 years ago

guiqide commented 3 years ago

Appear the error with below when using the curd library, is anyone have the same error?

// store.controller.ts
@Crud({
  model: {
    type: Store,
  },
})
...

// console
/Users/guiqide/files/data/booking-hair-server/node_modules/@nestjsx/crud/lib/crud/swagger.helper.js:71
                        [common_1.HttpStatus.OK]: {
                                             ^

TypeError: Cannot read property 'OK' of undefined
    at Function.createResponseMeta (/Users/guiqide/files/data/booking-hair-server/node_modules/@nestjsx/crud/lib/crud/swagger.helper.js:71:46)
    at CrudRoutesFactory.setSwaggerResponseOk (/Users/guiqide/files/data/booking-hair-server/node_modules/@nestjsx/crud/lib/crud/crud-routes.factory.js:430:56)
    at CrudRoutesFactory.setBaseRouteMeta (/Users/guiqide/files/data/booking-hair-server/node_modules/@nestjsx/crud/lib/crud/crud-routes.factory.js:353:14)
    at /Users/guiqide/files/data/booking-hair-server/node_modules/@nestjsx/crud/lib/crud/crud-routes.factory.js:264:22
    at Array.forEach (<anonymous>)
    at CrudRoutesFactory.createRoutes (/Users/guiqide/files/data/booking-hair-server/node_modules/@nestjsx/crud/lib/crud/crud-routes.factory.js:260:22)
    at CrudRoutesFactory.create (/Users/guiqide/files/data/booking-hair-server/node_modules/@nestjsx/crud/lib/crud/crud-routes.factory.js:49:14)
    at new CrudRoutesFactory (/Users/guiqide/files/data/booking-hair-server/node_modules/@nestjsx/crud/lib/crud/crud-routes.factory.js:19:14)
    at /Users/guiqide/files/data/booking-hair-server/node_modules/@nestjsx/crud/lib/decorators/crud.decorator.js:6:19
    at DecorateConstructor (/Users/guiqide/files/data/booking-hair-server/node_modules/reflect-metadata/Reflect.js:541:33)