Skip to content

Commit

Permalink
resolved migration issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Kashyap1ankit committed Oct 20, 2024
1 parent 23bec96 commit 2d28f42
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
-- AlterEnum
ALTER TYPE "Role" ADD VALUE 'HR';

-- DropForeignKey
ALTER TABLE "Job" DROP CONSTRAINT "Job_userId_fkey";

Expand Down
14 changes: 10 additions & 4 deletions src/actions/job.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ import { revalidatePath } from 'next/cache';
type additional = {
isVerifiedJob: boolean;
};

const reloadBookmarkPage = (path: string) => {
revalidatePath(path, 'page');
};

export const createJob = withServerActionAsyncCatcher<
JobPostSchemaType,
ServerActionReturnType<additional>
Expand Down Expand Up @@ -461,6 +466,8 @@ export async function CheckForBookmark(jobId: string) {
'BAD_REQUEST'
);

reloadBookmarkPage('/jobs');

const isBookmarked = await prisma.bookmark.findFirst({
where: {
jobId: jobId,
Expand All @@ -480,9 +487,6 @@ export async function CheckForBookmark(jobId: string) {
};
}
}
const reloadBookmarkPage = () => {
revalidatePath('/jobs');
};

export async function GetBookmarkByUserId() {
try {
Expand All @@ -493,6 +497,8 @@ export async function GetBookmarkByUserId() {

const userId = auth.user.id;

reloadBookmarkPage('/profile/bookmarks');

const getUserBookmarks = await prisma.bookmark.findMany({
where: {
userId: userId,
Expand Down Expand Up @@ -528,7 +534,7 @@ export async function GetBookmarkByUserId() {

if (!getUserBookmarks || getUserBookmarks.length === 0)
throw new Error('No Bookmarked Job found');
reloadBookmarkPage();

return {
status: 200,
message: 'Bookmarks fetched ',
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}

0 comments on commit 2d28f42

Please sign in to comment.