Skip to content

Commit e5dc4dd

Browse files
pwizlatomscytaleHastaCsstb13579
authored
🚀 Production hotfix: Fix broken links in Error Handling and Unit Testing docs (#1485)
* user-permissions plugin: document how to add Patreon as an Oauth provider * Update filtering-locale-publication.md (#1441) for this pull strapi/strapi#15046 * Update docs/developer-docs/latest/plugins/users-permissions.md * Update docs/developer-docs/latest/plugins/users-permissions.md * Fix broken links reported in issue #1423 (#1484) * Fix broken links reported in issue #1423 * Fix BE custom. > middlewares link --------- Co-authored-by: Tom Shortall <[email protected]> Co-authored-by: Jorge Martin <[email protected]> Co-authored-by: Shaun Brown <[email protected]>
1 parent f72fe79 commit e5dc4dd

File tree

4 files changed

+45
-4
lines changed

4 files changed

+45
-4
lines changed

‎docs/developer-docs/latest/developer-resources/database-apis-reference/rest/filtering-locale-publication.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ The following operators are available:
4646
| `$notNull` | Is not null |
4747
| `$between` | Is between |
4848
| `$startsWith` | Starts with |
49+
| `$startsWithi` | Starts with (case-insensitive) |
4950
| `$endsWith` | Ends with |
51+
| `$endsWithi` | Ends with (case-insensitive) |
5052
| `$or` | Joins the filters in an "or" expression |
5153
| `$and` | Joins the filters in an "and" expression |
5254

@@ -422,4 +424,4 @@ await request(`/api/articles?${query}`);
422424
```
423425

424426
:::
425-
::::
427+
::::

‎docs/developer-docs/latest/developer-resources/error-handling.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Errors thrown by the GraphQL API are included in the [response](/developer-docs/
6363

6464
### Controllers and middlewares
6565

66-
The recommended way to throw errors when developing any custom logic with Strapi is to have the [controller](/developer-docs/latest/development/backend-customization/controllers.md) or [middleware](/developer-docs/latest/development/backend-customization/) respond with the correct status and body.
66+
The recommended way to throw errors when developing any custom logic with Strapi is to have the [controller](/developer-docs/latest/development/backend-customization/controllers.md) or [middleware](/developer-docs/latest/development/backend-customization/middlewares.md) respond with the correct status and body.
6767

6868
This can be done by calling an error function on the context (i.e. `ctx`). Available error functions are listed in the [http-errors documentation](https://github.com/jshttp/http-errors#list-of-all-constructors) but their name should be lower camel-cased to be used by Strapi (e.g. `badRequest`).
6969

@@ -367,7 +367,7 @@ throw new PolicyError('Something went wrong', { policy: 'my-policy' });
367367

368368
::: tab Pagination
369369

370-
The `PaginationError` class is a specific error class that is typically used when parsing the pagination information from [REST](/developer-resources/database-apis-reference/rest/sort-pagination.md#pagination), [GraphQL](/developer-resources/database-apis-reference/graphql-api.md#pagination), or the [Entity Service](/developer-resources/database-apis-reference/entity-service/order-pagination.md#pagination). It accepts the following parameters:
370+
The `PaginationError` class is a specific error class that is typically used when parsing the pagination information from [REST](/developer-docs/latest/developer-resources/database-apis-reference/rest/sort-pagination.md#pagination), [GraphQL](/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.md#pagination), or the [Entity Service](/developer-docs/latest/developer-resources/database-apis-reference/entity-service/order-pagination.md#pagination). It accepts the following parameters:
371371

372372
| Parameter | Type | Description | Default |
373373
| --- | --- | --- | --- |

‎docs/developer-docs/latest/developer-resources/unit-testing.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ module.exports = ({ env }) => ({
9696
### Strapi instance
9797

9898
In order to test anything we need to have a strapi instance that runs in the testing environment,
99-
basically we want to get instance of strapi app as object, similar like creating an instance for [process manager](process-manager.md).
99+
basically we want to get instance of strapi app as object, similar like creating an instance for [process manager](/developer-docs/latest/setup-deployment-guides/deployment/optional-software/process-manager.md).
100100

101101
These tasks require adding some files - let's create a folder `tests` where all the tests will be put and inside it, next to folder `helpers` where main Strapi helper will be in file strapi.js.
102102

‎docs/developer-docs/latest/plugins/users-permissions.md‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,45 @@ The use of `ngrok` is not needed.
786786

787787
:::
788788

789+
::: tab Patreon
790+
791+
#### Using ngrok
792+
793+
Patreon does not accept `localhost` urls. <br>
794+
Use `ngrok` to serve the backend app.
795+
796+
```
797+
ngrok http 1337
798+
```
799+
800+
Don't forget to update the server url in the Strapi config file `./config/server.js` and the server URL in your frontend app (environment variable `REACT_APP_BACKEND_URL` if you use [react login example app](https://github.com/strapi/strapi-examples/tree/master/login-react)) with the generated ngrok URL.
801+
802+
#### Patreon configuration
803+
804+
- You must be a Patreon Creator in order to register an Oauth client.
805+
- Go to the [Patreon developer portal](https://www.patreon.com/portal)
806+
- Click on [Clients & API Keys](https://www.patreon.com/portal/registration/register-clients)
807+
- Click on "Create Client"
808+
- Enter the details of your organization and website.
809+
- There is a drop-down for "App Category" but no explanation of what the different categories mean.
810+
"Community" seems to work fine.
811+
- You can choose either version 1 or version 2 of the API - neither are actively developed.
812+
Version 2 is probably the best choice. See their
813+
[developer docs](https://docs.patreon.com/#introduction) for more detail.
814+
- Under "Redirect URI's" enter `https://your-site.com/api/connect/patreon/callback`
815+
- Save the client details and you will then see the Client ID and Client Secret.
816+
817+
#### Strapi configuration
818+
819+
- Visit the User Permissions provider settings page <br> [http://localhost:1337/admin/settings/users-permissions/providers](http://localhost:1337/admin/settings/users-permissions/providers)
820+
- Click on the **Patreon** provider
821+
- Fill the information:
822+
- Enable: `ON`
823+
- Client ID: `<Your Patreon Client ID>` - as above
824+
- Client Secret: `<Your Patreon Client Secret>` - as above
825+
826+
:::
827+
789828
::::
790829

791830
Your configuration is done.

0 commit comments

Comments
 (0)