add user profile, profile vibe and trip vibe and social signal
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { userRepo } from "@/server/repositories/user.repo";
|
||||
import { userRepo, type PeopleFilters } from "@/server/repositories/user.repo";
|
||||
import { tripRepo } from "@/server/repositories/trip.repo";
|
||||
import { participantRepo } from "@/server/repositories/participant.repo";
|
||||
import { organizerRepo } from "@/server/repositories/organizer.repo";
|
||||
@@ -11,12 +11,17 @@ export const profileService = {
|
||||
return profileRepo.findByUserId(userId);
|
||||
},
|
||||
|
||||
async findPeople(filters?: PeopleFilters) {
|
||||
return userRepo.findPeople(filters);
|
||||
},
|
||||
|
||||
async updateProfile(userId: string, input: UpdateProfileInput) {
|
||||
return profileRepo.upsertByUserId(userId, {
|
||||
bio: input.bio,
|
||||
city: input.city,
|
||||
instagram: input.instagram,
|
||||
interests: input.interests,
|
||||
vibe: input.vibe,
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Prisma } from "@/app/generated/prisma/client";
|
||||
import type { ActivityCategory } from "@/app/generated/prisma/enums";
|
||||
import type { ActivityCategory, Vibe } from "@/app/generated/prisma/enums";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { tripRepo, type TripFilters } from "@/server/repositories/trip.repo";
|
||||
import { participantRepo } from "@/server/repositories/participant.repo";
|
||||
@@ -31,6 +31,7 @@ interface CreateTripInput {
|
||||
endDate?: Date;
|
||||
maxParticipants: number;
|
||||
price: number;
|
||||
vibe?: Vibe;
|
||||
organizerId: string;
|
||||
imageUrls?: string[];
|
||||
}
|
||||
@@ -82,6 +83,7 @@ export const tripService = {
|
||||
endDate: input.endDate,
|
||||
maxParticipants: input.maxParticipants,
|
||||
price: input.price,
|
||||
vibe: input.vibe,
|
||||
organizer: { connect: { id: input.organizerId } },
|
||||
images,
|
||||
} satisfies Prisma.TripCreateInput;
|
||||
|
||||
Reference in New Issue
Block a user