260322:1648 Correct Coresspondence / Doing RFA / Correct CI
CI Pipeline / build (push) Failing after 12m41s
Build and Deploy / deploy (push) Failing after 2m44s

This commit is contained in:
admin
2026-03-22 16:48:12 +07:00
parent e5deedb42e
commit 11984bfa29
683 changed files with 105251 additions and 29068 deletions
@@ -1,4 +1,4 @@
import { IsInt, IsNotEmpty, IsOptional, ValidateIf } from 'class-validator';
import { IsInt, IsNotEmpty, IsOptional, _ValidateIf } from 'class-validator';
export class AssignRoleDto {
@IsInt()
@@ -11,7 +11,7 @@ import { UpdatePreferenceDto } from './dto/update-preference.dto';
export class UserPreferenceService {
constructor(
@InjectRepository(UserPreference)
private prefRepo: Repository<UserPreference>,
private prefRepo: Repository<UserPreference>
) {}
// ดึง Preference ของ User (ถ้าไม่มีให้สร้าง Default)
@@ -35,7 +35,7 @@ export class UserPreferenceService {
// อัปเดต Preference
async update(
userId: number,
dto: UpdatePreferenceDto,
dto: UpdatePreferenceDto
): Promise<UserPreference> {
const pref = await this.findByUser(userId);
+6 -8
View File
@@ -18,7 +18,6 @@ import { Permission } from './entities/permission.entity';
import { CreateUserDto } from './dto/create-user.dto';
import { UpdateUserDto } from './dto/update-user.dto';
import { SearchUserDto } from './dto/search-user.dto';
import { Organization } from '../organization/entities/organization.entity';
import { UuidResolverService } from '../../common/services/uuid-resolver.service';
@Injectable()
@@ -242,14 +241,13 @@ export class UserService {
}
// 2. ถ้าไม่มีใน Cache ให้ Query จาก DB (View: v_user_all_permissions)
const permissions = await this.usersRepository.query(
`SELECT permission_name FROM v_user_all_permissions WHERE user_id = ?`,
[userId]
);
const permissions = await this.usersRepository.query<
{ permission_name: string }[]
>(`SELECT permission_name FROM v_user_all_permissions WHERE user_id = ?`, [
userId,
]);
const permissionList = permissions.map(
(row: { permission_name: string }) => row.permission_name
);
const permissionList = permissions.map((row) => row.permission_name);
// 3. บันทึกลง Cache (TTL 1800 วินาที = 30 นาที)
await this.cacheManager.set(cacheKey, permissionList, 1800 * 1000);