drf-react-by-schema 0.8.1 → 0.8.2

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.
Files changed (2) hide show
  1. package/dist/api.js +8 -2
  2. package/package.json +1 -1
package/dist/api.js CHANGED
@@ -536,7 +536,10 @@ const getGenericModelList = ({ model, serverEndPoint, id = '', relatedModel = ''
536
536
  let modelOptions = loadedModelOptions;
537
537
  let columns;
538
538
  if (!(0, utils_1.isTmpId)(id) && relatedModel) {
539
- path += `/${relatedModel}/${relatedModelId}/`;
539
+ path += `/${relatedModel}/`;
540
+ if (relatedModelId) {
541
+ path += `${relatedModelId}/`;
542
+ }
540
543
  schemaPath += `${id}/${relatedModel}/`;
541
544
  }
542
545
  const queryParams = [];
@@ -640,7 +643,10 @@ const getGenericModel = ({ model, serverEndPoint, id = '', relatedModel = '', re
640
643
  let path = `${model}/${id}`;
641
644
  let schemaPath = `${model}/`;
642
645
  if (id && relatedModel) {
643
- path += `/${relatedModel}/${relatedModelId}/`;
646
+ path += `/${relatedModel}/`;
647
+ if (relatedModelId) {
648
+ path += `${relatedModelId}/`;
649
+ }
644
650
  schemaPath += `${id}/${relatedModel}/`;
645
651
  }
646
652
  else if (id) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drf-react-by-schema",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "Components and Tools for building a React App having Django Rest Framework (DRF) as server",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",