axe-api 0.18.0 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  strategy:
13
13
  matrix:
14
- node-version: [14.x, 16.x]
14
+ node-version: [14.x, 16.x, 17.x]
15
15
  database: [mysql8, mysql57, "postgres"]
16
16
  steps:
17
17
  - uses: actions/checkout@v2
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  strategy:
13
13
  matrix:
14
- node-version: [14.x, 16.x]
14
+ node-version: [14.x, 16.x, 17.x]
15
15
  steps:
16
16
  - uses: actions/checkout@v2
17
17
  - name: Use Node.js ${{ matrix.node-version }}
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release Notes
2
2
 
3
+ ## [0.18.1 (2021-12-02)](https://github.com/axe-api/axe-api/compare/0.18.1...0.18.0)
4
+
5
+ ### Fixed
6
+
7
+ - [#117](https://github.com/axe-api/axe-api/issues/117)
8
+
3
9
  ## [0.18.0 (2021-11-30)](https://github.com/axe-api/axe-api/compare/0.18.0...0.17.5)
4
10
 
5
11
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axe-api",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "AXE API is a simple tool which has been created based on Express and Knex.js to create Rest APIs quickly.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -45,7 +45,7 @@ export default async (context) => {
45
45
 
46
46
  let [insertedPrimaryKeyValue] = await trx(model.instance.table)
47
47
  .insert(formData)
48
- .returning("id");
48
+ .returning(model.instance.primaryKey);
49
49
 
50
50
  // If the user use a special primary key value, we should use that value
51
51
  if (insertedPrimaryKeyValue === 0) {
@@ -1,6 +1,6 @@
1
1
  import IoC from "./../core/IoC.js";
2
2
  import pluralize from "pluralize";
3
- import { paramCase } from "change-case";
3
+ import { paramCase, camelCase } from "change-case";
4
4
  import { RELATIONSHIPS, API_ROUTE_TEMPLATES } from "./../constants.js";
5
5
  import Handlers from "./../handlers/index.js";
6
6
 
@@ -122,7 +122,7 @@ const createNestedRoutes = async (
122
122
  await createRouteByModel(
123
123
  model,
124
124
  models,
125
- `${urlPrefix}${resource}/:${getPrimaryKeyName(model)}/`,
125
+ `${urlPrefix}${resource}/:${camelCase(relation.foreignKey)}/`,
126
126
  model,
127
127
  relation,
128
128
  false