chore: Move to Typescript (#2783)
This PR moves the entire project to Typescript. Due to the ~1000 ignores this will lead to a messy codebase for a while, but the churn is worth it – all of those ignore comments are places that were never type-safe previously. closes #1282
This commit is contained in:
19
server/presenters/groupMembership.ts
Normal file
19
server/presenters/groupMembership.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { GroupUser } from "@server/models";
|
||||
import { presentUser } from ".";
|
||||
|
||||
type GroupMembership = {
|
||||
id: string;
|
||||
userId: string;
|
||||
groupId: string;
|
||||
};
|
||||
|
||||
// @ts-expect-error ts-migrate(2749) FIXME: 'GroupUser' refers to a value, but is being used a... Remove this comment to see the full error message
|
||||
export default (membership: GroupUser): GroupMembership => {
|
||||
return {
|
||||
id: `${membership.userId}-${membership.groupId}`,
|
||||
userId: membership.userId,
|
||||
groupId: membership.groupId,
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type '{ id: string; userId: any; groupId: any; use... Remove this comment to see the full error message
|
||||
user: presentUser(membership.user),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user