-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Access the hardcoded query via dependencies #3342
- Loading branch information
1 parent
aaf06e7
commit 7755839
Showing
4 changed files
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/read-side/html-pages/search-page/construct-view-model/construct-view-model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/read-side/html-pages/search-page/construct-view-model/dependencies.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { ExternalQueries } from '../../../../third-parties'; | ||
|
||
export type Dependencies = ExternalQueries; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import * as TE from 'fp-ts/TaskEither'; | ||
import { pipe } from 'fp-ts/function'; | ||
import { constructViewModel } from './construct-view-model/construct-view-model'; | ||
import { Dependencies } from './construct-view-model/dependencies'; | ||
import { renderAsHtml } from './render-as-html/render-as-html'; | ||
import { constructErrorPageViewModel, ErrorPageViewModel } from '../construct-error-page-view-model'; | ||
import { HtmlPage } from '../html-page'; | ||
|
||
export const searchPage: TE.TaskEither<ErrorPageViewModel, HtmlPage> = pipe( | ||
constructViewModel(), | ||
export const searchPage = (dependencies: Dependencies): TE.TaskEither<ErrorPageViewModel, HtmlPage> => pipe( | ||
constructViewModel(dependencies), | ||
TE.bimap(constructErrorPageViewModel, renderAsHtml), | ||
); |