fix: gộp các nút của thành viên và guest vào một
This commit is contained in:
+16
-1
@@ -114,6 +114,21 @@ async function bootstrap() {
|
||||
prefix: '/uploads/',
|
||||
});
|
||||
|
||||
// Tự động tạo thư mục downloads nếu chưa tồn tại
|
||||
const downloadsDir = path.join(process.cwd(), 'public/downloads');
|
||||
if (!fs.existsSync(downloadsDir)) {
|
||||
fs.mkdirSync(downloadsDir, { recursive: true });
|
||||
}
|
||||
|
||||
// Khai báo thư mục lưu trữ APK tải về
|
||||
app.useStaticAssets(downloadsDir, {
|
||||
prefix: '/downloads/',
|
||||
setHeaders: (res) => {
|
||||
res.set('Content-Type', 'application/vnd.android.package-archive');
|
||||
res.set('Content-Disposition', 'attachment; filename="yotrip-latest.apk"');
|
||||
}
|
||||
});
|
||||
|
||||
const prisma = app.get(PrismaService);
|
||||
startAutoCleanup(prisma);
|
||||
|
||||
@@ -2463,7 +2478,7 @@ class UserController {
|
||||
return this.prisma.user.update({
|
||||
where: { id },
|
||||
data,
|
||||
select: { id: true, email: true, name: true, isAdmin: true, isBlocked: true }
|
||||
select: { id: true, email: true, name: true, isAdmin: true, isBlocked: true, avatar: true, phone: true, address: true }
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user