From baa76e7137fdd69253297ee19d1ed7348115598d Mon Sep 17 00:00:00 2001 From: hpawe01 Date: Wed, 7 Feb 2018 11:46:22 +0100 Subject: [PATCH 1/3] Update README.MD Add note about whitespaces when including multiple relationships --- README.MD | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.MD b/README.MD index 5c4a5cf9..998bd754 100644 --- a/README.MD +++ b/README.MD @@ -338,6 +338,8 @@ this.datastore.findRecord(Post, '1', { The library will try to resolve relationships on infinite levels connecting nested objects by reference. So that you can have a `Post`, with a list of `Comment`s, that have a `User` that has `Post`s, that have `Comment`s... etc. +**Note**: If you `include` multiple relationships, do not use whitespace in the `include` string (e.g. `comments, comments.user`) as those will be encoded to `%20` and result in a broken URL. + #### Creating Records If the object you want to create has a **one-to-many** relationship, you can do this: From 57737769e31b47f8f99116ad8f7d7adbbab23f24 Mon Sep 17 00:00:00 2001 From: hpawe01 Date: Wed, 7 Feb 2018 11:59:56 +0100 Subject: [PATCH 2/3] Update README.MD Fix wording --- README.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.MD b/README.MD index 998bd754..5777651d 100644 --- a/README.MD +++ b/README.MD @@ -338,7 +338,7 @@ this.datastore.findRecord(Post, '1', { The library will try to resolve relationships on infinite levels connecting nested objects by reference. So that you can have a `Post`, with a list of `Comment`s, that have a `User` that has `Post`s, that have `Comment`s... etc. -**Note**: If you `include` multiple relationships, do not use whitespace in the `include` string (e.g. `comments, comments.user`) as those will be encoded to `%20` and result in a broken URL. +**Note**: If you `include` multiple relationships, **do not** use whitespaces in the `include` string (e.g. `comments, comments.user`) as those will be encoded to `%20` and this results in a broken URL. #### Creating Records From 0833e6a0feb35270e8bc8908df448ad6cf947c13 Mon Sep 17 00:00:00 2001 From: hpawe01 Date: Wed, 7 Feb 2018 12:12:16 +0100 Subject: [PATCH 3/3] Add basic example for using filters I know, the server decides how to implement filter strategies, but I think this further clarifies the use of the params argument. --- README.MD | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.MD b/README.MD index 5777651d..06900cf7 100644 --- a/README.MD +++ b/README.MD @@ -185,7 +185,10 @@ constructor(private datastore: Datastore) { } getPosts(){ this.datastore.findAll(Post, { - page: { size: 10, number: 1} + page: { size: 10, number: 1 }, + filter: { + title: 'My Post', + }, }).subscribe( (posts: JsonApiQueryData) => console.log(posts.getModels()) );