feat: Pin to home (#2880)
This commit is contained in:
@@ -26,7 +26,7 @@ async function replaceImageAttachments(text: string) {
|
||||
|
||||
export default async function present(
|
||||
document: any,
|
||||
options: Options | null | undefined
|
||||
options: Options | null | undefined = {}
|
||||
) {
|
||||
options = {
|
||||
isPublic: false,
|
||||
@@ -58,7 +58,6 @@ export default async function present(
|
||||
starred: document.starred ? !!document.starred.length : undefined,
|
||||
revision: document.revisionCount,
|
||||
fullWidth: document.fullWidth,
|
||||
pinned: undefined,
|
||||
collectionId: undefined,
|
||||
parentDocumentId: undefined,
|
||||
lastViewedAt: undefined,
|
||||
@@ -69,8 +68,6 @@ export default async function present(
|
||||
}
|
||||
|
||||
if (!options.isPublic) {
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'boolean' is not assignable to type 'undefine... Remove this comment to see the full error message
|
||||
data.pinned = !!document.pinnedById;
|
||||
data.collectionId = document.collectionId;
|
||||
data.parentDocumentId = document.parentDocumentId;
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'UserPresentation | null | undefined' is not ... Remove this comment to see the full error message
|
||||
|
||||
@@ -10,6 +10,7 @@ import presentGroupMembership from "./groupMembership";
|
||||
import presentIntegration from "./integration";
|
||||
import presentMembership from "./membership";
|
||||
import presentNotificationSetting from "./notificationSetting";
|
||||
import presentPin from "./pin";
|
||||
import presentPolicies from "./policy";
|
||||
import presentRevision from "./revision";
|
||||
import presentSearchQuery from "./searchQuery";
|
||||
@@ -37,6 +38,7 @@ export {
|
||||
presentMembership,
|
||||
presentNotificationSetting,
|
||||
presentSlackAttachment,
|
||||
presentPin,
|
||||
presentPolicies,
|
||||
presentGroupMembership,
|
||||
presentCollectionGroupMembership,
|
||||
|
||||
10
server/presenters/pin.ts
Normal file
10
server/presenters/pin.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export default function present(pin: any) {
|
||||
return {
|
||||
id: pin.id,
|
||||
documentId: pin.documentId,
|
||||
collectionId: pin.collectionId,
|
||||
index: pin.index,
|
||||
createdAt: pin.createdAt,
|
||||
updatedAt: pin.updatedAt,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user