Skip to content

Instantly share code, notes, and snippets.

Last active August 18, 2020 09:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
interface BookDetailsViewModel {
title: string
is_available: boolean
export function getBookById(dependencies: Dependencies) {
return async (req: Request, res: Response) => {
try {
const result = await dependencies
} catch (e) {
function _mapToBookDetailsViewModel(result: BookDetails): BookDetailsViewModel {
return {
title: result.title,
is_available: result.isAvailable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment