Skip to content

Commit

Permalink
add getAll method to tags adapter (#21287)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattapperson committed Aug 7, 2018
1 parent fcfe75b commit e417d3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ import { BeatTag } from '../../../../common/domain_types';

export interface CMTagsAdapter {
getTagsWithIds(tagIds: string[]): Promise<BeatTag[]>;
getAll(): Promise<BeatTag[]>;
upsertTag(tag: BeatTag): Promise<{}>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export class MemoryTagsAdapter implements CMTagsAdapter {
return this.tagsDB.filter(tag => tagIds.includes(tag.id));
}

public async getAll() {
return this.tagsDB;
}

public async upsertTag(tag: BeatTag) {
const existingTagIndex = this.tagsDB.findIndex(t => t.id === tag.id);
if (existingTagIndex !== -1) {
Expand Down

0 comments on commit e417d3a

Please sign in to comment.