Skip to content

Commit 101fa40

Browse files
committed
disable user join event
1 parent c786e04 commit 101fa40

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed
Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
11
// import { createUserJoinJob } from 'queue/jobs';
22

3-
import { ChannelType, prisma } from '@linen/database';
4-
import { notifyChannels } from 'services/channels/userJoined';
3+
// import { ChannelType, prisma } from '@linen/database';
4+
// import { notifyChannels } from 'services/channels/userJoined';
55

66
export type UserJoin = {
77
userId: string;
88
};
99

1010
export async function eventUserJoin(event: UserJoin) {
11-
await Promise.allSettled([
12-
userJoinTask(event), // run it synchronously
13-
]);
11+
// await Promise.allSettled([
12+
// userJoinTask(event), // run it synchronously
13+
// ]);
1414
}
1515

16-
const userJoinTask = async (payload: { userId: string }) => {
17-
const user = await prisma.users.findUnique({
18-
where: { id: payload.userId },
19-
include: { auth: true, account: true },
20-
});
16+
// const userJoinTask = async (payload: { userId: string }) => {
17+
// const user = await prisma.users.findUnique({
18+
// where: { id: payload.userId },
19+
// include: { auth: true, account: true },
20+
// });
2121

22-
if (user && user.auth && user.account) {
23-
const channels = await prisma.channels.findMany({
24-
select: { id: true, channelName: true },
25-
where: {
26-
accountId: user.account.id,
27-
hidden: false,
28-
default: true,
29-
type: ChannelType.PUBLIC,
30-
},
31-
});
22+
// if (user && user.auth && user.account) {
23+
// const channels = await prisma.channels.findMany({
24+
// select: { id: true, channelName: true },
25+
// where: {
26+
// accountId: user.account.id,
27+
// hidden: false,
28+
// default: true,
29+
// type: ChannelType.PUBLIC,
30+
// },
31+
// });
3232

33-
if (channels.length) {
34-
await prisma.memberships.createMany({
35-
data: channels.map((c) => {
36-
return {
37-
usersId: user.id,
38-
channelsId: c.id,
39-
};
40-
}),
41-
skipDuplicates: true,
42-
});
43-
await notifyChannels(user, channels);
44-
}
45-
}
46-
};
33+
// if (channels.length) {
34+
// await prisma.memberships.createMany({
35+
// data: channels.map((c) => {
36+
// return {
37+
// usersId: user.id,
38+
// channelsId: c.id,
39+
// };
40+
// }),
41+
// skipDuplicates: true,
42+
// });
43+
// await notifyChannels(user, channels);
44+
// }
45+
// }
46+
// };

0 commit comments

Comments
 (0)