Skip to content

Commit 1bcd361

Browse files
author
Chris Ian Fiel
committed
refractor
1 parent a071db5 commit 1bcd361

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
1-
import { Item } from "../../domain/entities/Item"
1+
import Item from "../../domain/entities/Item"
22
import { ItemRepository } from "../../domain/repositories/ItemRepository"
33

4-
class ItemDTO {
5-
id = 0
6-
7-
name = ""
8-
}
9-
104
export 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
}

0 commit comments

Comments
 (0)