general destination and verify

This commit is contained in:
2026-05-08 18:23:51 +07:00
parent 2de8ac4086
commit 63349a144d
21 changed files with 2535 additions and 56 deletions
+33
View File
@@ -0,0 +1,33 @@
import { prisma } from "@/lib/prisma";
interface UpsertProfileInput {
bio?: string;
city?: string;
instagram?: string;
interests: string[];
}
export const profileRepo = {
async findByUserId(userId: string) {
return prisma.userProfile.findUnique({ where: { userId } });
},
async upsertByUserId(userId: string, data: UpsertProfileInput) {
return prisma.userProfile.upsert({
where: { userId },
create: {
userId,
bio: data.bio,
city: data.city,
instagram: data.instagram,
interests: data.interests,
},
update: {
bio: data.bio,
city: data.city,
instagram: data.instagram,
interests: data.interests,
},
});
},
};