Skip to content

Commit d7fe9e5

Browse files
committed
feat: adds A'nanatawas Loader and edits loaders.module.ts file
1 parent 4e59cc4 commit d7fe9e5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lesson_10/libraries/src/loaders/ananatawa_loader.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ export class AnanatawasLoader implements Loader {
2020
}
2121

2222
async loadMediaItems(): Promise<MediaItem[]> {
23-
const credits = [];
23+
const MediaItems = [];
2424
const readable = fs
2525
.createReadStream('data/media_items.csv', 'utf-8')
2626
.pipe(csv());
2727
for await (const row of readable) {
28-
const { media_item_id, role, name } = row;
29-
credits.push(new Credit(media_item_id, name, role));
28+
const { id, title, type, year } = row;
29+
MediaItems.push(new MediaItem(id, title, type, year, []));
3030
}
31-
return [];
31+
return MediaItems;
3232
}
3333

3434
async loadCredits(): Promise<Credit[]> {

lesson_10/libraries/src/loaders/loaders.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { Module } from '@nestjs/common';
22

3-
import { AnanatawaLoader } from './ananatawa_loader.js';
3+
import { AnanatawasLoader } from './ananatawa_loader.js';
44
import { AnthonyMaysLoader } from './anthony_mays_loader.js';
55

66
export const Loaders = Symbol.for('Loaders');
77

8-
const LOADER_PROVIDERS = [AnthonyMaysLoader, AnanatawaLoader];
8+
const LOADER_PROVIDERS = [AnthonyMaysLoader, AnanatawasLoader];
99

1010

1111
@Module({

0 commit comments

Comments
 (0)