Skip to content

Commit

Permalink
ar(temp) auth stuff messy
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloreale committed Jul 13, 2024
1 parent 6bc7d28 commit 9ba2eb0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
6 changes: 3 additions & 3 deletions prisma/mock/messages.mts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const createMockMessage = ({
user,
fromUser,
fromCommunity,
toUsers,
toUser,
toCommunities,
toListings,
toAudiences,
Expand All @@ -39,8 +39,8 @@ export const createMockMessage = ({
queuedOn: new Date(),
scheduledOn: new Date(),
sentOn: new Date(),
toUsers: {
connect: toUsers,
toUser: {
connect: toUser,
},
toCommunities: {
connect: toCommunities,
Expand Down
6 changes: 3 additions & 3 deletions prisma/mock/taxonomies.mts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const createMockTerm = ({
community,
targetCommunities,
targetAudiences,
targetUsers,
targetUser,
listings,
models,
}: any): any => {
Expand All @@ -26,8 +26,8 @@ export const createMockTerm = ({
status: 'ACTIVE',
type: 'TAG',
nature: 'SEGMENTED',
targetUsers: {
connect: targetUsers,
targetUser: {
connect: targetUser,
},
targetCommunities: {
connect: targetCommunities,
Expand Down
1 change: 0 additions & 1 deletion prisma/mock/user.mts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export const createMockUser = () => ({
name: faker.person.fullName(),
email: faker.internet.email(),
image: faker.image.avatar(),
emailVerified: false,
firstName: 'Vars',
lastName: 'Nothing',
birthday: new Date(),
Expand Down
2 changes: 2 additions & 0 deletions prisma/schema-private.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ model VerificationToken {
expires DateTime
@@unique([identifier, token])
@@map("verificationToken")
}

// Optional for WebAuthn support
Expand All @@ -67,6 +68,7 @@ model Authenticator {
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@unique([userId, credentialID])
@@map("authenticator")
}

model User {
Expand Down
16 changes: 8 additions & 8 deletions prisma/seed.mts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ if (seedType === 'private') {
~~~~ PRIVATE ~~~~
*/

const user1 = await pvtPrisma.users.create({ data: mockUser });
const user2 = await pvtPrisma.users.create({ data: mockUser2 });
const user3 = await pvtPrisma.users.create({ data: mockUser3 });
const user1 = await pvtPrisma.user.create({ data: mockUser });
const user2 = await pvtPrisma.user.create({ data: mockUser2 });
const user3 = await pvtPrisma.user.create({ data: mockUser3 });

// communities
const community1 = await pvtPrisma.communities.create({ data: mockCommunity });
Expand Down Expand Up @@ -105,7 +105,7 @@ if (seedType === 'private') {
user: user2.id,
listings: [{ id: listing1.id }],
targetCommunities: [{ id: community2.id }],
targetUsers: [{ id: user2.id }],
targetUser: [{ id: user2.id }],
}),
});
const term2 = await pvtPrisma.taxonomies.create({
Expand All @@ -114,7 +114,7 @@ if (seedType === 'private') {
user: user2.id,
listings: [{ id: listing2.id }],
targetCommunities: [{ id: community3.id }],
targetUsers: [{ id: user3.id }],
targetUser: [{ id: user3.id }],
}),
});

Expand All @@ -124,7 +124,7 @@ if (seedType === 'private') {
community: community3.id,
user: user2.id,
fromUser: { id: user3.id },
toUsers: [{ id: user1.id }, { id: user2.id }],
toUser: [{ id: user1.id }, { id: user2.id }],
toCommunities: [],
toListings: [],
}),
Expand All @@ -134,7 +134,7 @@ if (seedType === 'private') {
community: community3.id,
user: user2.id,
fromUser: { id: user2.id },
toUsers: [],
toUser: [],
toCommunities: [{ id: community2.id }, { id: community3.id }],
toListings: [{ id: listing1.id }, { id: listing2.id }],
}),
Expand All @@ -144,7 +144,7 @@ if (seedType === 'private') {
community: community3.id,
user: user2.id,
fromCommunity: { id: community3.id },
toUsers: [],
toUser: [],
toCommunities: [],
toListings: [],
}),
Expand Down

0 comments on commit 9ba2eb0

Please sign in to comment.