mirror of
https://github.com/outline/outline.git
synced 2026-06-26 01:34:23 +03:00
28 lines
650 B
JavaScript
28 lines
650 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,
|
|
icon: collection.icon,
|
|
color: collection.color || "#4E5C6E",
|
|
private: collection.private,
|
|
createdAt: collection.createdAt,
|
|
updatedAt: collection.updatedAt,
|
|
deletedAt: collection.deletedAt,
|
|
documents: collection.documentStructure ? collection.documentStructure : [],
|
|
};
|
|
|
|
return data;
|
|
}
|