18 lines
426 B
JavaScript
18 lines
426 B
JavaScript
// @flow
|
|
import { Share } from '../models';
|
|
import { presentUser } from '.';
|
|
|
|
function present(ctx: Object, share: Share) {
|
|
return {
|
|
id: share.id,
|
|
documentTitle: share.document.title,
|
|
documentUrl: share.document.getUrl(),
|
|
url: `${process.env.URL}/share/${share.id}`,
|
|
createdBy: presentUser(ctx, share.user),
|
|
createdAt: share.createdAt,
|
|
updatedAt: share.updatedAt,
|
|
};
|
|
}
|
|
|
|
export default present;
|