@raphiniert/ra-data-postgrest 1.1.9 → 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,7 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Find all notable changes of this project in this file.
|
|
4
4
|
|
|
5
|
-
## v1.1
|
|
5
|
+
## v1.2.1 - 2023-04-07
|
|
6
|
+
- small fix in condition
|
|
7
|
+
- fixed package name
|
|
8
|
+
|
|
9
|
+
## v1.2.0 - 2022-08-23
|
|
10
|
+
- [#33](https://github.com/raphiniert-com/ra-data-postgrest/pull/33), adding dependabot - @[promitheus7](https://github.com/promitheus7)
|
|
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)
|
|
12
|
+
|
|
13
|
+
## v1.1.9 - 2022-08-23
|
|
6
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)
|
|
7
15
|
|
|
8
16
|
## v1.1.8 - 2022-01-07
|
package/README.md
CHANGED
|
@@ -8,6 +8,8 @@ PostgREST Data Provider for [react-admin](https://github.com/marmelab/react-admi
|
|
|
8
8
|
npm install --save @raphiniert/ra-data-postgrest
|
|
9
9
|
```
|
|
10
10
|
|
|
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.
|
|
12
|
+
|
|
11
13
|
## REST Dialect
|
|
12
14
|
|
|
13
15
|
This Data Provider fits REST APIs using simple GET parameters for filters and sorting. This is the dialect used for instance in [PostgREST](http://postgrest.org).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fetchUtils, DataProvider } from 'ra-core';
|
|
2
|
-
|
|
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;
|
|
@@ -44,7 +44,7 @@ import { fetchUtils } from 'ra-core';
|
|
|
44
44
|
*
|
|
45
45
|
* import * as React from 'react';
|
|
46
46
|
* import { Admin, Resource } from 'react-admin';
|
|
47
|
-
* import postgrestRestProvider from '@
|
|
47
|
+
* import postgrestRestProvider from '@promitheus/ra-data-postgrest';
|
|
48
48
|
*
|
|
49
49
|
* import { PostList } from './posts';
|
|
50
50
|
*
|
|
@@ -111,7 +111,7 @@ var encodeId = function (data, primaryKey) {
|
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
113
|
var dataWithId = function (data, primaryKey) {
|
|
114
|
-
if (primaryKey ===
|
|
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
|
-
|
|
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;
|
|
@@ -46,7 +46,7 @@ var ra_core_1 = require("ra-core");
|
|
|
46
46
|
*
|
|
47
47
|
* import * as React from 'react';
|
|
48
48
|
* import { Admin, Resource } from 'react-admin';
|
|
49
|
-
* import postgrestRestProvider from '@
|
|
49
|
+
* import postgrestRestProvider from '@promitheus/ra-data-postgrest';
|
|
50
50
|
*
|
|
51
51
|
* import { PostList } from './posts';
|
|
52
52
|
*
|
|
@@ -113,7 +113,7 @@ var encodeId = function (data, primaryKey) {
|
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
115
|
var dataWithId = function (data, primaryKey) {
|
|
116
|
-
if (primaryKey ===
|
|
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.1
|
|
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",
|
|
@@ -33,6 +33,6 @@
|
|
|
33
33
|
"typescript": "^4.6.4"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"ra-core": "^
|
|
36
|
+
"ra-core": "^4.1.0"
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -23,7 +23,7 @@ import { fetchUtils, DataProvider, Identifier } from 'ra-core';
|
|
|
23
23
|
*
|
|
24
24
|
* import * as React from 'react';
|
|
25
25
|
* import { Admin, Resource } from 'react-admin';
|
|
26
|
-
* import postgrestRestProvider from '@
|
|
26
|
+
* import postgrestRestProvider from '@promitheus/ra-data-postgrest';
|
|
27
27
|
*
|
|
28
28
|
* import { PostList } from './posts';
|
|
29
29
|
*
|
|
@@ -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 ===
|
|
103
|
+
if (primaryKey.length == 1 && primaryKey.keys()[0] === 'id') {
|
|
104
104
|
return data;
|
|
105
105
|
}
|
|
106
106
|
|