mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-22 21:11:14 +00:00
fix(ci): list the packing share pair, and read a stored costs mode through its enum
The whole-list sharing runs on usePackingCategorySharing in the packing panel and the phone tab, its sheet is markup fed by the tab. The trips service reads a stored costs_mode as one of TripsCostsMode, which the export check wants used.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { EntityManager } from '@mikro-orm/core';
|
||||
import { Trips } from '../../db/entities/Trips.entity';
|
||||
import { Trips, TripsCostsMode } from '../../db/entities/Trips.entity';
|
||||
import { Days } from '../../db/entities/Days.entity';
|
||||
import { JourneyEntries } from '../../db/entities/JourneyEntries.entity';
|
||||
import { Users } from '../../db/entities/Users.entity';
|
||||
@@ -34,7 +34,6 @@ import {
|
||||
type DayGridRemoval,
|
||||
type TrekWsPayload,
|
||||
type TrekWsTripEventName,
|
||||
type TripCostsMode,
|
||||
type TripUpdateRequest,
|
||||
} from '@trek/shared';
|
||||
import { RealtimeService } from '../realtime/realtime.service';
|
||||
@@ -474,8 +473,9 @@ export class TripsService {
|
||||
const newCurrency = currency || trip.currency;
|
||||
const newArchived = is_archived !== undefined ? (is_archived ? 1 : 0) : trip.is_archived;
|
||||
const newCover = cover_image !== undefined ? cover_image : trip.cover_image;
|
||||
// The column's CHECK holds a stored trip to the two modes.
|
||||
const newCostsMode = costs_mode ?? (trip.costs_mode as TripCostsMode);
|
||||
// A stored trip is read as one of the two modes the column allows.
|
||||
const storedCostsMode = trip.costs_mode === TripsCostsMode.TOTALS ? TripsCostsMode.TOTALS : TripsCostsMode.SPLIT;
|
||||
const newCostsMode = costs_mode ?? storedCostsMode;
|
||||
const oldReminder = (trip as any).reminder_days ?? 3;
|
||||
const newReminder = reminder_days !== undefined
|
||||
? (Number(reminder_days) >= 0 && Number(reminder_days) <= 30 ? Number(reminder_days) : oldReminder)
|
||||
|
||||
Reference in New Issue
Block a user