general category trip
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Prisma } from "@/app/generated/prisma/client";
|
||||
import type { ActivityCategory } from "@/app/generated/prisma/enums";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { tripRepo } from "@/server/repositories/trip.repo";
|
||||
import { tripRepo, type TripFilters } from "@/server/repositories/trip.repo";
|
||||
import { participantRepo } from "@/server/repositories/participant.repo";
|
||||
import { LIMITS } from "@/lib/limits";
|
||||
import { utcStartOfDay, isTripDepartureDayPast } from "@/lib/trip-dates";
|
||||
@@ -17,9 +18,10 @@ function isSerializationConflict(err: unknown): boolean {
|
||||
}
|
||||
|
||||
interface CreateTripInput {
|
||||
category: ActivityCategory;
|
||||
title: string;
|
||||
description?: string;
|
||||
mountain: string;
|
||||
destination: string;
|
||||
location: string;
|
||||
meetingPoint?: string;
|
||||
itinerary?: string;
|
||||
@@ -34,7 +36,7 @@ interface CreateTripInput {
|
||||
}
|
||||
|
||||
export const tripService = {
|
||||
async getOpenTrips(filters?: { q?: string; from?: string; to?: string }) {
|
||||
async getOpenTrips(filters?: TripFilters) {
|
||||
return tripRepo.findOpen(filters);
|
||||
},
|
||||
|
||||
@@ -67,9 +69,10 @@ export const tripService = {
|
||||
: undefined;
|
||||
|
||||
const tripData = {
|
||||
category: input.category,
|
||||
title: input.title,
|
||||
description: input.description,
|
||||
mountain: input.mountain,
|
||||
destination: input.destination,
|
||||
location: input.location,
|
||||
meetingPoint: input.meetingPoint,
|
||||
itinerary: input.itinerary,
|
||||
|
||||
Reference in New Issue
Block a user