270
let collections: IUserDataCollectionManifest | undefined = undefined;
271
if (this.collectionCounter) {
273
>
for (let collectionId = 1; collectionId <= this.collectionCounter; collectionId++) {
274
>
const collectionData = this.collections.get(`${collectionId}`);
275
>
if (collectionData) {
276
>
const latest: Record<ServerResource, string> = Object.create({});
277
>
collectionData.forEach((value, key) => latest[key] = value.ref);
278
>
collections[`${collectionId}`] = { latest };
279
>
}
280
>
}
281
>
}
282
const manifest: IUserDataManifest = { session: this.session, latest, collections, ref: '1' };
283
return this.toResponse(200, { 'Content-Type': 'application/json', etag: `${this.manifestRef++}` }, JSON.stringify(manifest));