Skip to content

Commit

Permalink
refactor: new hubInvite schema
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-737 committed Oct 5, 2024
1 parent 7d5fc62 commit a8dc2c1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
9 changes: 5 additions & 4 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ model Hub {
createdAt DateTime @default(now())
settings Int // each bit is a setting
// all the stuff below is relations to other collections
invites hubInvites[]
invites HubInvite[]
moderators HubModerator[]
connections connectedList[]
logConfig HubLogConfig[]
Expand All @@ -146,12 +146,13 @@ model HubLogConfig {
@@index([id, hubId])
}

model hubInvites {
id String @id @default(auto()) @map("_id") @db.ObjectId
code String @unique @default(nanoid(10))
model HubInvite {
code String @id @default(nanoid(10)) @map("_id")
expires DateTime
hub Hub @relation(fields: [hubId], references: [id])
hubId String @db.ObjectId
@@index([code, hubId])
}

model originalMessages {
Expand Down
1 change: 0 additions & 1 deletion src/commands/slash/Main/hub/logging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export default class LoggingCommand extends HubCommand {
'You must set the logging channel before setting the role ID.',
{ ephemeral: true },
);
return;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/HubLogger/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const sendHubReport = async (
const hub = await db.hub.findFirst({ where: { id: hubId }, include: { logConfig: true } });
if (!hub?.logConfig[0]?.reports?.channelId) return;

const { channelId: reportsChannelId, roleId: reportsRoleId } = hub?.logConfig[0]?.reports;
const { channelId: reportsChannelId, roleId: reportsRoleId } = hub.logConfig[0].reports;
const server = await client.fetchGuild(serverId);
const jumpLink = await genJumpLink(hubId, client, evidence?.messageId, reportsChannelId);

Expand Down

0 comments on commit a8dc2c1

Please sign in to comment.