init: init project

This commit is contained in:
2026-04-02 21:27:09 +06:00
commit 81f9801487
45 changed files with 1857 additions and 0 deletions
@@ -0,0 +1,26 @@
import { Request } from "express";
import uploadCloud from "../../utils/cloudinary";
import { prisma } from "../../lib/prisma";
import { JwtPayloadType } from "../../utils/JWT";
const update_profile_into_db = async (req: Request) => {
const user = req?.user as JwtPayloadType;
const payload = req?.body;
const file = req?.file;
// check file and upload to cloud
if (file) {
const cloudRes = await uploadCloud(file);
payload.profilePhoto = cloudRes?.secure_url;
}
const result = await prisma.profile.update({
where: {
accountId: user.accountId as string,
},
data: payload,
});
return result;
};
export const profile_service = {
update_profile_into_db,
};