The problems are: /api/v1/product/1/category route with { "name": "Category 1" } POST JSON data
and /api/v1/product/1/price route with { "price": 10000 } POST JSON data
creates method is not a function error
Maybe the getMethod function inside src/utils.js called from inside create function inside src/associations/one-to-one.js cannot find the correct method, so its returns false.
Or maybe i missed something on my setup?
I have 3 models:
* product with 1 field: name
* category with 1 field: name
* price with 1 field: price
Associations are:
* product belongsTo category
* product hasMany price
* price belongsTo product
The problems are:
`/api/v1/product/1/category` route with `{ "name": "Category 1" }` POST JSON data
and
`/api/v1/product/1/price` route with `{ "price": 10000 }` POST JSON data
creates **method is not a function** error
Maybe the **getMethod** function inside **src/utils.js** called from inside **create** function inside **src/associations/one-to-one.js** cannot find the correct method, so its returns false.
Or maybe i missed something on my setup?
Hi @labibramadhan If I understand you correctly, you're trying to create a new category that belongs to product with id=1. That's not currently something we support. But I would be happy to look at a pull request that adds that functionality.
In the meantime, you can always do:
POST /api/v1/category {"name": "Category 1", "productId": 1}
Hi @labibramadhan If I understand you correctly, you're trying to create a new category that belongs to `product` with `id=1`. That's not currently something we support. But I would be happy to look at a pull request that adds that functionality.
In the meantime, you can always do:
`POST /api/v1/category {"name": "Category 1", "productId": 1}`
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
I have 3 models:
Associations are:
The problems are:
/api/v1/product/1/categoryroute with{ "name": "Category 1" }POST JSON dataand
/api/v1/product/1/priceroute with{ "price": 10000 }POST JSON datacreates method is not a function error
Maybe the getMethod function inside src/utils.js called from inside create function inside src/associations/one-to-one.js cannot find the correct method, so its returns false.
Or maybe i missed something on my setup?
Hi @labibramadhan If I understand you correctly, you're trying to create a new category that belongs to
productwithid=1. That's not currently something we support. But I would be happy to look at a pull request that adds that functionality.In the meantime, you can always do:
POST /api/v1/category {"name": "Category 1", "productId": 1}@joeybaker ah i see, exactly i was trying to test the features based on README.MD
We'd happily take a PR that updates the README