Skip to content

Commit

Permalink
fix conflicts and build
Browse files Browse the repository at this point in the history
  • Loading branch information
devsharmagit committed Oct 31, 2024
1 parent 0bebe98 commit 5b9f388
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
26 changes: 26 additions & 0 deletions prisma/migrations/20241031064849_company/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
Warnings:
- A unique constraint covering the columns `[companyId]` on the table `User` will be added. If there are existing duplicate values, this will fail.
*/
-- AlterTable
ALTER TABLE "User" ADD COLUMN "companyId" TEXT,
ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;

-- CreateTable
CREATE TABLE "Company" (
"id" TEXT NOT NULL,
"companyName" TEXT NOT NULL,
"companyLogo" TEXT,
"companyEmail" TEXT NOT NULL,
"companyBio" TEXT NOT NULL,

CONSTRAINT "Company_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "User_companyId_key" ON "User"("companyId");

-- AddForeignKey
ALTER TABLE "User" ADD CONSTRAINT "User_companyId_fkey" FOREIGN KEY ("companyId") REFERENCES "Company"("id") ON DELETE SET NULL ON UPDATE CASCADE;
7 changes: 4 additions & 3 deletions src/actions/user.profile.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ export const getUserDetails = async () => {
}
};


export const getUserDetailsWithId = async (id: string) => {
try {
const res = await prisma.user.findFirst({
Expand Down Expand Up @@ -622,7 +621,10 @@ export const deleteEducation = async (educationId: number) => {
});
revalidatePath(`/newProfile/${auth.user.id}`);
return new SuccessResponse('Project Deleted Successfully', 200).serialize();

} catch (_error) {
return new ErrorHandler('Internal server error', 'DATABASE_ERROR');
}
};
export const getUserRecruiters = async () => {
const auth = await getServerSession(authOptions);

Expand Down Expand Up @@ -654,7 +656,6 @@ export const getUserRecruiters = async () => {
return new SuccessResponse('Recruiter SuccessFully Fetched', 200, {
recruiters: res,
}).serialize();

} catch (_error) {
return new ErrorHandler('Internal server error', 'DATABASE_ERROR');
}
Expand Down

0 comments on commit 5b9f388

Please sign in to comment.