mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-18 14:41:41 +03:00
11 lines
342 B
JavaScript
11 lines
342 B
JavaScript
import HttpError from '@wasp/core/HttpError.js'
|
|
|
|
export const getListsAndCards = async (args, context) => {
|
|
if (!context.user) { throw new HttpError(403) }
|
|
return context.entities.List.findMany({
|
|
// We want to make sure user can get only his own info.
|
|
where: { user: { id: context.user.id } },
|
|
include: { cards: true }
|
|
})
|
|
}
|