-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
slight changes to frontend + add route
- Loading branch information
1 parent
12c29a7
commit b7acf30
Showing
3 changed files
with
21 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,12 @@ | ||
import { adminAuthenticatedProcedureBuilder } from "../internal/init"; | ||
|
||
export const userView = adminAuthenticatedProcedureBuilder.query( | ||
export const getAdminViewProcedure = adminAuthenticatedProcedureBuilder.query( | ||
async ({ ctx }) => { | ||
const users = ctx.prisma.user.findMany(); | ||
|
||
return users; | ||
}, | ||
); | ||
|
||
export const groupView = adminAuthenticatedProcedureBuilder.query( | ||
async ({ ctx }) => { | ||
const groups = ctx.prisma.group.findMany(); | ||
|
||
return groups; | ||
}, | ||
); | ||
|
||
export const groupInvitesView = adminAuthenticatedProcedureBuilder.query( | ||
async ({ ctx }) => { | ||
const groupInvites = ctx.prisma.groupInvite.findMany(); | ||
|
||
return groupInvites; | ||
const [users, groups, groupInvites] = await Promise.all([ | ||
ctx.prisma.user.findMany(), | ||
ctx.prisma.group.findMany(), | ||
ctx.prisma.groupInvite.findMany(), | ||
]); | ||
return { users, groups, groupInvites }; | ||
}, | ||
); |