Skip to content

Commit

Permalink
😀Added: Readme docs
Browse files Browse the repository at this point in the history
  • Loading branch information
coderj001 committed Oct 10, 2023
1 parent 47f46b8 commit 3c279c3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pnpm start:prod

## Paths

| Path | Source | Method | Response | Queries |
| :-----: | :--------: | :----: | :------------: | :-----: |
| /api/v1 | characters | GET | All characters | soon |
| Path | Source | Method | Response | Queries |
| :-----: | :------------: | :----: | :------------------: | :-----: |
| /api/v1 | characters | GET | All characters | soon |
| /api/v1 | characters/:id | GET | Only character by id | -- |
12 changes: 9 additions & 3 deletions rest.http
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ GET {{baseURL}}/health
Content-Type: application/json

### Characters
### FindAll
GET {{baseURL}}/api/v1/characters
Content-Type: application/json
### Find All
GET {{baseURL}}/api/v1/characters?limit=10
Content-Type: application/json

### Find By Name
GET {{baseURL}}/api/v1/characters?name=gojo

### Find By Id
GET {{baseURL}}/api/v1/characters/2
4 changes: 1 addition & 3 deletions src/characters/characters.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import { CharactersService, IQuery } from "./characters.service";
import { serializeStringToNumeric } from "../helper/serialize-string-numeric";

export class CharactersController {
constructor(private readonly charactersService: CharactersService) {}
constructor(private readonly charactersService: CharactersService) { }

// async findAll({ limit, name, offset, sort }: IQuerystring = {}) {
async findAll({ limit, offset, name }: IQuerystring = {}) {
// const isSorted = sort != undefined && sort != null && Boolean(sort);
if (name) {
return await this.charactersService.findByName(name);
}
Expand Down

0 comments on commit 3c279c3

Please sign in to comment.