Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions backend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,10 @@ module.exports = {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
}],
},
};
186 changes: 67 additions & 119 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},
"dependencies": {
"@aws-sdk/client-s3": "^3.975.0",
"@aws-sdk/s3-request-presigner": "^3.1075.0",
"@nestjs/bull": "^11.0.4",
"@nestjs/cache-manager": "^3.1.0",
"@nestjs/common": "^10.0.0",
Expand Down Expand Up @@ -67,9 +68,9 @@
"papaparse": "^5.5.3",
"passport": "^0.7.0",
"passport-google-oauth20": "^2.0.0",
"passport-microsoft": "^1.0.0",
"passport-jwt": "^4.0.1",
"passport-local": "^1.0.0",
"passport-microsoft": "^1.0.0",
"pdfkit": "^0.17.2",
"pg": "^8.11.3",
"qrcode": "^1.5.4",
Expand Down
12 changes: 11 additions & 1 deletion backend/src/activity-log/activity-log.controller.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
import { Controller, Get, Post, Delete, Param, Body, Query, Req, UseGuards } from '@nestjs/common';
import {
Controller,
Get,
Post,
Delete,
Param,
Body,
Query,
Req,
UseGuards,
} from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
import { ActivityLogService } from './activity-log.service';
import { CreateActivityLogDto } from './dtos/create-activity-log.dto';
Expand Down
18 changes: 15 additions & 3 deletions backend/src/activity-log/activity-log.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,21 @@ export class ActivityLogService {
return this.activityLogRepository.save(log);
}

async findAll(query: ActivityLogQueryDto): Promise<{ data: ActivityLog[]; total: number }> {
const { page = 1, limit = 20, userId, action, entityType, entityId, startDate, endDate } = query;
const qb = this.activityLogRepository.createQueryBuilder('log')
async findAll(
query: ActivityLogQueryDto,
): Promise<{ data: ActivityLog[]; total: number }> {
const {
page = 1,
limit = 20,
userId,
action,
entityType,
entityId,
startDate,
endDate,
} = query;
const qb = this.activityLogRepository
.createQueryBuilder('log')
.leftJoinAndSelect('log.user', 'user')
.skip((page - 1) * limit)
.take(limit)
Expand Down
10 changes: 9 additions & 1 deletion backend/src/activity-log/entities/activity-log.entity.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, ManyToOne, JoinColumn } from 'typeorm';
import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
UpdateDateColumn,
ManyToOne,
JoinColumn,
} from 'typeorm';
import { User } from '../../users/entities/user.entity';

@Entity('activity_logs')
Expand Down
Loading