Skip to content

Commit

Permalink
fix: fix JSdoc, from Array<Hero> to Hero only
Browse files Browse the repository at this point in the history
  • Loading branch information
domingo1021 committed Jul 6, 2024
1 parent aa0d958 commit bef7e08
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/modules/hero/hero.repository.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class HeroRepositoryImpl implements HeroRepository {

/**
* @description Get single hero in cache-aside strategy: get cache first, if not exist, fetch from external API.
* @returns {Promise<Array<Hero>>}
* @returns {Promise<Hero>}
* @throws {InternalServerErrorException}
*/
async getHeroById(id: string): Promise<Hero> {
Expand All @@ -76,7 +76,7 @@ export class HeroRepositoryImpl implements HeroRepository {

/**
* @description Get single hero with profile in cache-aside strategy: get cache first, if not exist, fetch from external API.
* @returns {Promise<Array<Hero>>}
* @returns {Promise<Hero>}
* @throws {InternalServerErrorException}
*/
async getHeroWithProfileById(id: string): Promise<Hero> {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/hero/hero.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class HeroService {
* @description Get single heroes with profile if authenticated, otherwise get single heroes only
* @param {string} id - Hero ID
* @param {boolean} isAuthenticated - Flag to determine if hero profile should be fetched
* @returns {Promise<Array<Hero>>}
* @returns {Promise<Hero>}
* @throws {InternalServerErrorException}
*/
async findById(id: string, isAuthenticated: boolean = false): Promise<Hero> {
Expand Down
4 changes: 2 additions & 2 deletions src/modules/http/http.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class ExternalHttpService {

/**
* @description Get single hero from external api, throw if response is in invalid format / network error.
* @returns {Promise<Array<Hero>>}
* @returns {Promise<Hero>}
* @throws {InternalServerErrorException}
*/
async getHeroById(id: string): Promise<Hero> {
Expand Down Expand Up @@ -84,7 +84,7 @@ export class ExternalHttpService {

/**
* @description Get single hero profile, throw if response is in invalid format / network error.
* @returns {Promise<Array<HeroProfile>>}
* @returns {Promise<HeroProfile>}
* @throws {InternalServerErrorException}
*/
async getHeroProfileById(id: string): Promise<HeroProfile> {
Expand Down

0 comments on commit bef7e08

Please sign in to comment.