mirror of
https://github.com/outline/outline.git
synced 2026-06-28 10:44:25 +03:00
32 lines
688 B
JavaScript
32 lines
688 B
JavaScript
// @flow
|
|
import { Collection } from '../models';
|
|
|
|
type Document = {
|
|
children: Document[],
|
|
id: string,
|
|
title: string,
|
|
url: string,
|
|
};
|
|
|
|
export default function present(collection: Collection) {
|
|
const data = {
|
|
id: collection.id,
|
|
url: collection.url,
|
|
name: collection.name,
|
|
description: collection.description,
|
|
color: collection.color || '#4E5C6E',
|
|
type: collection.type,
|
|
private: collection.private,
|
|
createdAt: collection.createdAt,
|
|
updatedAt: collection.updatedAt,
|
|
deletedAt: collection.deletedAt,
|
|
documents: undefined,
|
|
};
|
|
|
|
if (collection.type === 'atlas') {
|
|
data.documents = collection.documentStructure;
|
|
}
|
|
|
|
return data;
|
|
}
|