diff --git a/front/src/init/filters.ts b/front/src/init/filters.ts index cebb1cbf2..3412fe8ba 100644 --- a/front/src/init/filters.ts +++ b/front/src/init/filters.ts @@ -116,9 +116,9 @@ export function humanSize (bytes: number) { } // Removes duplicates from a list -export function unique (list: { [key: string]: unknown }[], property: string) { +export function unique (list: Record[], property: string) { property = property || 'id' - const unique: { [key: string]: unknown }[] = [] + const unique: Record[] = [] list.map(x => unique.filter(a => a[property] === x[property]).length > 0 ? null : unique.push(x)) return unique } diff --git a/front/src/utils/index.ts b/front/src/utils/index.ts index dfb34ba93..a7a38e45b 100644 --- a/front/src/utils/index.ts +++ b/front/src/utils/index.ts @@ -3,7 +3,7 @@ import { Store } from 'vuex' import { Router } from 'vue-router' import { APIErrorResponse } from '~/types' -export function setUpdate (obj: object, statuses: { [key: string]: unknown }, value: unknown) { +export function setUpdate (obj: object, statuses: Record, value: unknown) { for (const key of Object.keys(obj)) { statuses[key] = value }