Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

fix(service): use uniqBy instead of uniq #38

Merged
merged 1 commit into from
Feb 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/service.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import angular from 'angular';
import flatten from 'lodash/flatten';
import get from 'lodash/get';
import uniq from 'lodash/uniq';
import uniqBy from 'lodash/uniqBy';

export default /* @ngInject */ ($q, $timeout, $http) => class {
constructor(opts) {
Expand All @@ -21,7 +21,7 @@ export default /* @ngInject */ ($q, $timeout, $http) => class {
return this.source
.then((source) => $http.get(`${source}&sort=asc&limit=500`))
.then((response) => {
this.logs = uniq(
this.logs = uniqBy(
flatten([...this.logs, get(response, 'data.messages', [])]),
(log) => log.message._id, // eslint-disable-line no-underscore-dangle
);
Expand Down