Sửa hiển thị tên/email của người thanh toán
This commit is contained in:
+12
-7
@@ -250,13 +250,18 @@ export const AddLocationModal = ({ isOpen, onClose, tourId, initialLegId, editin
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-xs font-bold text-gray-600 mb-1">Thành viên đã thanh toán</label>
|
<label className="block text-xs font-bold text-gray-600 mb-1">Thành viên đã thanh toán</label>
|
||||||
<select className="w-full px-3 py-2 bg-white border border-gray-200 rounded-xl outline-none text-sm"
|
<select className="w-full px-3 py-2 bg-white border border-gray-200 rounded-xl outline-none text-sm"
|
||||||
value={formData.paidById} onChange={e => setFormData({...formData, paidById: e.target.value})}>
|
value={formData.paidById} onChange={e => setFormData({...formData, paidById: e.target.value})}>
|
||||||
<option value="">-- Chọn người thanh toán --</option>
|
<option value="">-- Chọn người thanh toán --</option>
|
||||||
{currentTour?.participants?.map((p: any) => (
|
{currentTour?.participants?.map((p: any) => {
|
||||||
<option key={p.userId} value={p.userId}>{p.user?.name || p.userId}</option>
|
const name = p.user?.name;
|
||||||
))}
|
const email = p.user?.email;
|
||||||
</select>
|
const label = [name, email && name ? `(${email})` : email].filter(Boolean).join(' ');
|
||||||
|
return (
|
||||||
|
<option key={p.userId} value={p.userId}>{label || p.userId}</option>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
Vendored
+6
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -7,10 +7,10 @@ export declare class JwtStrategy extends JwtStrategy_base {
|
|||||||
private prisma;
|
private prisma;
|
||||||
constructor(prisma: PrismaService);
|
constructor(prisma: PrismaService);
|
||||||
validate(payload: any): Promise<{
|
validate(payload: any): Promise<{
|
||||||
|
name: string | null;
|
||||||
id: string;
|
id: string;
|
||||||
email: string;
|
email: string;
|
||||||
passwordHash: string;
|
passwordHash: string;
|
||||||
name: string | null;
|
|
||||||
avatar: string | null;
|
avatar: string | null;
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
isAdmin: boolean;
|
isAdmin: boolean;
|
||||||
|
|||||||
Vendored
+7
-1
@@ -305,7 +305,13 @@ let TourController = class TourController {
|
|||||||
const tour = await this.prisma.tour.findUnique({
|
const tour = await this.prisma.tour.findUnique({
|
||||||
where: { id },
|
where: { id },
|
||||||
include: {
|
include: {
|
||||||
participants: true,
|
participants: {
|
||||||
|
include: {
|
||||||
|
user: {
|
||||||
|
select: { id: true, name: true, email: true }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
photos: true,
|
photos: true,
|
||||||
legs: {
|
legs: {
|
||||||
orderBy: { sequence: 'asc' },
|
orderBy: { sequence: 'asc' },
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -339,7 +339,13 @@ class TourController {
|
|||||||
const tour = await this.prisma.tour.findUnique({
|
const tour = await this.prisma.tour.findUnique({
|
||||||
where: { id },
|
where: { id },
|
||||||
include: {
|
include: {
|
||||||
participants: true,
|
participants: {
|
||||||
|
include: {
|
||||||
|
user: {
|
||||||
|
select: { id: true, name: true, email: true }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
photos: true,
|
photos: true,
|
||||||
legs: {
|
legs: {
|
||||||
orderBy: { sequence: 'asc' },
|
orderBy: { sequence: 'asc' },
|
||||||
|
|||||||
Reference in New Issue
Block a user