-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yoginth
committed
Oct 4, 2024
1 parent
fba3bdb
commit fb3fe64
Showing
11 changed files
with
72 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Permission, PermissionId } from "@hey/data/permissions"; | ||
import prisma from "../client"; | ||
|
||
const seedPermissions = async (): Promise<number> => { | ||
// Delete all permissions | ||
await prisma.permission.deleteMany(); | ||
|
||
// Seed permissions | ||
const permissions = await prisma.permission.createMany({ | ||
data: [ | ||
{ id: PermissionId.CommentSuspended, key: Permission.CommentSuspended }, | ||
{ id: PermissionId.Suspended, key: Permission.Suspended }, | ||
{ id: PermissionId.Verified, key: Permission.Verified }, | ||
{ id: PermissionId.StaffPick, key: Permission.StaffPick }, | ||
{ id: PermissionId.Beta, key: Permission.Beta } | ||
] | ||
}); | ||
|
||
return permissions.count; | ||
}; | ||
|
||
export default seedPermissions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { TEST_LENS_ID } from "@hey/data/constants"; | ||
import { PermissionId } from "@hey/data/permissions"; | ||
import prisma from "../client"; | ||
|
||
const seedProfilePermission = async (): Promise<number> => { | ||
// Delete all profile permissions | ||
await prisma.profilePermission.deleteMany(); | ||
|
||
// Seed profile permissions | ||
const profilePermissions = await prisma.profilePermission.createMany({ | ||
data: [{ permissionId: PermissionId.Verified, profileId: TEST_LENS_ID }] | ||
}); | ||
|
||
return profilePermissions.count; | ||
}; | ||
|
||
export default seedProfilePermission; |