From 39a3be6c0592efd38be8b5faa2ecc0a261e799d2 Mon Sep 17 00:00:00 2001 From: Yugay Vasiliy Date: Mon, 22 Apr 2024 13:30:51 +0000 Subject: [PATCH] added function to fetch following or preceding signs in requested order --- src/signs/application/SignService.ts | 7 +++++++ src/signs/infrastructure/SignRepository.ts | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/src/signs/application/SignService.ts b/src/signs/application/SignService.ts index 16c262c65..86bf3d1b4 100644 --- a/src/signs/application/SignService.ts +++ b/src/signs/application/SignService.ts @@ -33,4 +33,11 @@ export default class SignService { listAllSigns(): Bluebird { return this.signsRepository.listAllSigns() } + findSignsByOrder( + signName: string, + order: string, + sortEra: string + ): Bluebird { + return this.signsRepository.findSignsByOrder(signName, order, sortEra) + } } diff --git a/src/signs/infrastructure/SignRepository.ts b/src/signs/infrastructure/SignRepository.ts index db1e6fa22..b4dcce592 100644 --- a/src/signs/infrastructure/SignRepository.ts +++ b/src/signs/infrastructure/SignRepository.ts @@ -80,6 +80,15 @@ class SignRepository { listAllSigns(): Promise { return this.apiClient.fetchJson(`/signs/all`, false) } + findSignsByOrder( + signName: string, + order: string, + sortEra: string + ): Promise { + return this.apiClient.fetchJson( + `/signs/${encodeURIComponent(signName)}/${order}/${sortEra}` + ) + } } export default SignRepository