Browse Source

dom server tweak

David Sehnal 7 years ago
parent
commit
5551b1dd08

+ 1 - 2
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);

+ 1 - 2
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