mirror of
https://github.com/dillonkearns/elm-pages.git
synced 2024-09-11 09:05:28 +03:00
Update prisma example code.
This commit is contained in:
parent
93408eb17b
commit
a3a385d643
@ -98,7 +98,7 @@ data routeParams =
|
||||
Server.Request.succeed
|
||||
(BackendTask.Custom.run "users"
|
||||
Encode.null
|
||||
(Decode.list (Decode.field "" Decode.string))
|
||||
(Decode.list (Decode.field "name" Decode.string))
|
||||
|> BackendTask.allowFatal
|
||||
|> BackendTask.map
|
||||
(\users ->
|
||||
|
@ -5,10 +5,7 @@ const prisma = new PrismaClient();
|
||||
|
||||
export async function users() {
|
||||
try {
|
||||
const users = await prisma.user.findMany({
|
||||
include: { profile: true },
|
||||
});
|
||||
return users;
|
||||
return await prisma.user.findMany();
|
||||
} catch (error) {
|
||||
console.trace(error);
|
||||
return ["PRISMA ERROR"];
|
||||
|
Loading…
Reference in New Issue
Block a user