mirror of
https://github.com/outline/outline.git
synced 2026-11-21 21:44:30 +03:00
* Add showLastModified option to Share models - Add showLastModified column to shares table with migration - Add showLastModified field to client and server Share models - Add 'Show last modified' toggle in share popover (PublicAccess component) - Update shares.update API route to handle showLastModified field - Include share data in documents.info API response for shared documents - Modify DocumentMeta visibility logic to show timestamp when showLastModified is enabled - Add proper type definitions across component hierarchy - Follow existing patterns used by allowIndexing option * Applied automatic fixes * refactor --------- Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com> Co-authored-by: Tom Moor <tom@getoutline.com>
30 lines
810 B
TypeScript
30 lines
810 B
TypeScript
import { Share } from "@server/models";
|
|
import { presentUser } from ".";
|
|
|
|
export default function presentShare(share: Share, isAdmin = false) {
|
|
const data = {
|
|
id: share.id,
|
|
documentId: share.documentId,
|
|
documentTitle: share.document?.title,
|
|
documentUrl: share.document?.url,
|
|
published: share.published,
|
|
url: share.canonicalUrl,
|
|
urlId: share.urlId,
|
|
createdBy: presentUser(share.user),
|
|
includeChildDocuments: share.includeChildDocuments,
|
|
allowIndexing: share.allowIndexing,
|
|
showLastUpdated: share.showLastUpdated,
|
|
lastAccessedAt: share.lastAccessedAt || undefined,
|
|
views: share.views || 0,
|
|
domain: share.domain,
|
|
createdAt: share.createdAt,
|
|
updatedAt: share.updatedAt,
|
|
};
|
|
|
|
if (!isAdmin) {
|
|
delete data.lastAccessedAt;
|
|
}
|
|
|
|
return data;
|
|
}
|