Files
outline/server/presenters/membership.ts
Apoorv Mishra 7145f7ef51 UserPermission and GroupPermission models (#5860)
* fix: rename to group_permissions

* fix: delete null collectionId records before setting non null constraint

* fix: use scope with collectionId not null

* fix: update model with documentId

* fix: rename to GroupPermission

* fix: rename collection_users to user_permissions

* fix: teamPermanentDeleter test

* fix: use scope with collectionId not null

* fix: update model with documentId

* fix: rename to UserPermission

* fix: create views upon table rename for zero downtime

* fix: remove comments
2023-09-25 10:51:29 +05:30

21 lines
506 B
TypeScript

import { CollectionPermission } from "@shared/types";
import { UserPermission } from "@server/models";
type Membership = {
id: string;
userId: string;
collectionId?: string | null;
permission: CollectionPermission;
};
export default function presentMembership(
membership: UserPermission
): Membership {
return {
id: `${membership.userId}-${membership.collectionId}`,
userId: membership.userId,
collectionId: membership.collectionId,
permission: membership.permission,
};
}