File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 1- import { Item } from "../../domain/entities/Item"
1+ import Item from "../../domain/entities/Item"
22import { ItemRepository } from "../../domain/repositories/ItemRepository"
33
4- class ItemDTO {
5- id = 0
6-
7- name = ""
8- }
9-
104export default class ItemRepositoryImpl implements ItemRepository {
115 jsonUrl =
126 "https://gist.githubusercontent.com/janithl/6bfbd787a0361c170ac760e8fb5ba0fd/raw/a0ffacb7c0fc21a0266371f632cf4107f80362f4/itemlist.json"
137
148 async GetItems ( ) : Promise < Item [ ] > {
159 const res = await fetch ( this . jsonUrl )
1610 const jsonData = await res . json ( )
17- return jsonData . map ( ( item : ItemDTO ) => ( { id : item . id , name : item . name } ) )
11+ return jsonData . map ( ( item : Item ) => ( { id : item . id , name : item . name } ) )
1812 }
1913}
You can’t perform that action at this time.
0 commit comments