@raphiniert/ra-data-postgrest 1.2.0 → 1.2.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.
package/CHANGELOG.md CHANGED
@@ -2,11 +2,15 @@
2
2
 
3
3
  Find all notable changes of this project in this file.
4
4
 
5
- ## v1.2.0 - 2023-08-23
5
+ ## v1.2.1 - 2023-04-07
6
+ - small fix in condition
7
+ - fixed package name
8
+
9
+ ## v1.2.0 - 2022-08-23
6
10
  - [#33](https://github.com/raphiniert-com/ra-data-postgrest/pull/33), adding dependabot - @[promitheus7](https://github.com/promitheus7)
7
11
  - [#30](https://github.com/raphiniert-com/ra-data-postgrest/pull/30) and [#33](https://github.com/raphiniert-com/ra-data-postgrest/pull/33), updated dependency to compatible starting from `ra-core` 4.1.x - @[corrideat](https://github.com/corrideat), @[promitheus7](https://github.com/promitheus7)
8
12
 
9
- ## v1.1.9 - 2023-08-23
13
+ ## v1.1.9 - 2022-08-23
10
14
  - [#30](https://github.com/raphiniert-com/ra-data-postgrest/pull/30), updated ts and modified code, such that some package dependencies became unrequired - @[corrideat](https://github.com/corrideat)
11
15
 
12
16
  ## v1.1.8 - 2022-01-07
package/README.md CHANGED
@@ -5,7 +5,7 @@ PostgREST Data Provider for [react-admin](https://github.com/marmelab/react-admi
5
5
  ## Installation
6
6
 
7
7
  ```sh
8
- npm install --save @promitheus/ra-data-postgrest
8
+ npm install --save @raphiniert/ra-data-postgrest
9
9
  ```
10
10
 
11
11
  **NOTE**: When using RA 3.x.x, use the data-provider 1.x.x. For RA >= 4.1.x use the data-provider starting from 1.2.x.
@@ -44,7 +44,7 @@ Access-Control-Expose-Headers: Content-Range
44
44
  // in src/App.js
45
45
  import React from 'react';
46
46
  import { Admin, Resource } from 'react-admin';
47
- import postgrestRestProvider from '@promitheus/ra-data-postgrest';
47
+ import postgrestRestProvider from '@raphiniert/ra-data-postgrest';
48
48
 
49
49
  import { PostList } from './posts';
50
50
 
@@ -65,7 +65,7 @@ That means that if you need to add custom headers to your requests, you just nee
65
65
 
66
66
  ```jsx
67
67
  import { fetchUtils, Admin, Resource } from 'react-admin';
68
- import postgrestRestProvider from '@promitheus/ra-data-postgrest';
68
+ import postgrestRestProvider from '@raphiniert/ra-data-postgrest';
69
69
 
70
70
  const httpClient = (url, options = {}) => {
71
71
  if (!options.headers) {
@@ -109,7 +109,7 @@ With one of the starter kits it is very easy to use the authProvider:
109
109
  // in src/App.js
110
110
  import React from 'react';
111
111
  import { Admin, Resource } from 'react-admin';
112
- import postgrestRestProvider, { authProvider } from '@promitheus/ra-data-postgrest';
112
+ import postgrestRestProvider, { authProvider } from '@raphiniert/ra-data-postgrest';
113
113
 
114
114
  import { PostList } from './posts';
115
115
 
@@ -1,5 +1,5 @@
1
1
  import { fetchUtils, DataProvider } from 'ra-core';
2
- declare type PrimaryKey = Array<string>;
2
+ type PrimaryKey = Array<string>;
3
3
  declare const _default: (apiUrl: any, httpClient?: (url: any, options?: fetchUtils.Options) => Promise<{
4
4
  status: number;
5
5
  headers: Headers;
@@ -111,7 +111,7 @@ var encodeId = function (data, primaryKey) {
111
111
  }
112
112
  };
113
113
  var dataWithId = function (data, primaryKey) {
114
- if (primaryKey === ['id']) {
114
+ if (primaryKey.length == 1 && primaryKey.keys()[0] === 'id') {
115
115
  return data;
116
116
  }
117
117
  return Object.assign(data, {
@@ -1,5 +1,5 @@
1
1
  import { fetchUtils, DataProvider } from 'ra-core';
2
- declare type PrimaryKey = Array<string>;
2
+ type PrimaryKey = Array<string>;
3
3
  declare const _default: (apiUrl: any, httpClient?: (url: any, options?: fetchUtils.Options) => Promise<{
4
4
  status: number;
5
5
  headers: Headers;
@@ -113,7 +113,7 @@ var encodeId = function (data, primaryKey) {
113
113
  }
114
114
  };
115
115
  var dataWithId = function (data, primaryKey) {
116
- if (primaryKey === ['id']) {
116
+ if (primaryKey.length == 1 && primaryKey.keys()[0] === 'id') {
117
117
  return data;
118
118
  }
119
119
  return Object.assign(data, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raphiniert/ra-data-postgrest",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "postgREST data provider for react-admin",
5
5
  "main": "lib/index.js",
6
6
  "module": "esm/index.js",
@@ -100,7 +100,7 @@ const encodeId = (data: any, primaryKey: PrimaryKey): Identifier => {
100
100
  }
101
101
 
102
102
  const dataWithId = (data: any, primaryKey: PrimaryKey) => {
103
- if (primaryKey === ['id']) {
103
+ if (primaryKey.length == 1 && primaryKey.keys()[0] === 'id') {
104
104
  return data;
105
105
  }
106
106