diff --git a/src/apps/domain-annotation-server/mapping.ts b/src/apps/domain-annotation-server/mapping.ts index 42098a4ff44d8f0cb9cef392eecd79c65b3bee72..419e4c270aadf0af6098eb159c808253ae24d9ac 100644 --- a/src/apps/domain-annotation-server/mapping.ts +++ b/src/apps/domain-annotation-server/mapping.ts @@ -44,10 +44,9 @@ function writeDomain(enc: CIFEncoder<any>, domain: DomainAnnotation | undefined) function getSources(data: any): Table<S.Sources> { const rows: Table.Row<S.Sources>[] = []; - let id = 1; for (const name of Object.keys(S.categories)) { if (!data[name]) continue; - const row: Table.Row<S.Sources> = { id: id++, name, count: Object.keys(data[name]).length }; + const row: Table.Row<S.Sources> = { id: name, count: Object.keys(data[name]).length }; if (row.count > 0) rows.push(row); } return Table.ofRows(S.Sources, rows); diff --git a/src/apps/domain-annotation-server/schemas.ts b/src/apps/domain-annotation-server/schemas.ts index 7b76600f0fbadee71f29c6e01719e21769f92ad2..34f17d5669b9b1187ccd545d8b092b437345d81d 100644 --- a/src/apps/domain-annotation-server/schemas.ts +++ b/src/apps/domain-annotation-server/schemas.ts @@ -9,8 +9,7 @@ import { Column } from 'mol-base/collections/database' import Type = Column.Type export const Sources = { - id: Type.int, - name: Type.str, + id: Type.str, count: Type.int } export type Sources = typeof Sources