From d8947d090e81b9cc203922570a521f31e7c29387 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Mon, 22 Jul 2024 11:56:16 -0700 Subject: [PATCH] Added docs --- README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/README.md b/README.md index 16d5232c9..eae2d9e8c 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ You can see the designs [here](https://www.figma.com/design/RPSfaw66HjzSwzntKcgD - POST [/api/v1/auth/register](#post-register) - POST [/api/v1/auth/login](#post-login) - POST [/api/v1/auth/user/{userId}](#post-auth-user-edit-id) + - GET [/api/v1/auth/users](#get-all-users-id) - POST [/api/v1/auth/recovery/request](#post-auth-recovery-request-id) - POST [/api/v1/auth/recovery/validate](#post-auth-recovery-validate-id) - POST [/api/v1/auth/recovery/reset](#post-auth-recovery-reset-id) @@ -453,6 +454,55 @@ curl --request POST \ +
+GET/api/v1/auth/users + +###### Method/Headers + +> | Method/Headers | Value | +> | -------------- | ----- | +> | Method | GET | + +###### Response Payload + +> | Type | Notes | +> | ------------- | ------------------------------------- | +> | `Array` | Returns an array containing all users | + +##### Sample CURL request + +``` +curl --request GET \ + --url http://localhost:5000/api/v1/auth/users \ + --header 'Authorization: \ + --header 'User-Agent: insomnia/2023.5.8' +``` + +##### Sample Resonse + +```json +{ + "success": true, + "msg": "Got all users", + "data": [ + { + "_id": "669e90072d5663d25808bc7b", + "firstName": "Alex", + "lastName": "Holliday", + "email": "test@test.com", + "isActive": true, + "isVerified": false, + "role": ["admin"], + "createdAt": "2024-07-22T16:59:51.695Z", + "updatedAt": "2024-07-22T16:59:51.695Z", + "__v": 0 + } + ] +} +``` + +
+
POST/api/v1/auth/recovery/request