LogRepository.js 563 B

123456789101112131415161718192021222324
  1. const prisma = require('../../prisma/PrismaClient.js');
  2. const LogRepository = {
  3. findAll: async ({ skip, take, where, orderBy }) => {
  4. return prisma.activityLog.findMany({
  5. where,
  6. skip,
  7. take,
  8. orderBy,
  9. select: {
  10. id: true,
  11. username: true,
  12. action: true,
  13. createdAt: true,
  14. },
  15. });
  16. },
  17. countAll: async (where) => {
  18. return prisma.activityLog.count({ where });
  19. },
  20. }
  21. module.exports = LogRepository;