* fix: accomodate membership id * fix: remove only * fix: event handling * fix: tests * fix: use transaction * Remove useless test --------- Co-authored-by: Tom Moor <tom.moor@gmail.com>
21 lines
470 B
TypeScript
21 lines
470 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.id,
|
|
userId: membership.userId,
|
|
collectionId: membership.collectionId,
|
|
permission: membership.permission,
|
|
};
|
|
}
|