Skip to content

Instantly share code, notes, and snippets.

@sodiray
Last active August 9, 2022 23:00
Show Gist options
  • Select an option

  • Save sodiray/93d683e11395123cef51a98714ef49df to your computer and use it in GitHub Desktop.

Select an option

Save sodiray/93d683e11395123cef51a98714ef49df to your computer and use it in GitHub Desktop.
import * as t from 'src/types'
export class ListingView {
static toView(model: t.Listing): t.ListingView {
return {
_view: 'listing',
id: model.id,
title: model.title,
categoryId: model.categoryId,
description: model.description,
price: model.price,
userId: model.userId
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment