fix: keep deal edits and right-align club leaderboard
Empty product lists were wiping the manual amount on update, and follow-ups were only created for new deals. Leaderboard rows were laid out left-to-right on an RTL page. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -225,14 +225,15 @@ export class DealsService {
|
||||
}
|
||||
|
||||
const data: Prisma.DealUncheckedUpdateInput = {};
|
||||
const pricedFromLines = (dto.lineItems?.length ?? 0) > 0;
|
||||
if (dto.title !== undefined) data.title = dto.title.trim();
|
||||
if ('amount' in dto && dto.lineItems === undefined) {
|
||||
if ('amount' in dto && !pricedFromLines) {
|
||||
data.amount =
|
||||
dto.amount == null || Number.isNaN(Number(dto.amount))
|
||||
? null
|
||||
: new Prisma.Decimal(dto.amount);
|
||||
}
|
||||
if (dto.currency !== undefined && dto.lineItems === undefined) {
|
||||
if (dto.currency !== undefined && !pricedFromLines) {
|
||||
data.currency = dto.currency.trim() || 'IRR';
|
||||
}
|
||||
if ('source' in dto) data.source = emptyToNull(dto.source);
|
||||
@@ -270,7 +271,7 @@ export class DealsService {
|
||||
assigneeConnect = assigneeIds.map((uid) => ({ id: uid }));
|
||||
}
|
||||
|
||||
if (dto.lineItems !== undefined) {
|
||||
if (pricedFromLines && dto.lineItems) {
|
||||
const total = sumLineItems(dto.lineItems);
|
||||
data.amount =
|
||||
total == null ? null : new Prisma.Decimal(total);
|
||||
|
||||
Reference in New Issue
Block a user