Skip to content

Commit

Permalink
Hot fix/add job page id and fix UI (#120)
Browse files Browse the repository at this point in the history
* updated URL

* updated env name

* added alert after sending email

* sort email by added time

* added indication while adding and sending email

* added jobPageId to POST

* updated modal form z-index
  • Loading branch information
mai-vu authored May 29, 2024
1 parent df9cf03 commit 6ffe0c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/admin-panel/home/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ export default function Home() {
</div>
{/* Render the form as a modal */}
{showForm && (
<div className="fixed top-0 left-0 w-full h-full flex items-center justify-center bg-gray-800 bg-opacity-50">
<div className="bg-white p-2 rounded shadow-lg max-h-[90vh] w-full max-w-4xl overflow-y-auto">
<div className="fixed top-0 left-0 z-50 w-full h-full flex items-center justify-center bg-gray-800 bg-opacity-50">
<div className="bg-white p-2 rounded shadow-lg max-h-[90vh] w-full max-w-4xl overflow-y-auto z-60">
<AddJobPostingForm
onSubmit={handleFormSubmit}
email={user.email}
Expand Down
5 changes: 5 additions & 0 deletions src/app/api/job-posting/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
parseSortCriteria,
parseFilterCriteria,
} from '@/app/api/job-posting/siteRequestUtils';
import crypto from 'crypto';

export async function GET(req) {
try {
Expand Down Expand Up @@ -98,6 +99,10 @@ export async function POST(req) {

// Iterate over each job posting object in the array and create it
for (const jobPostingData of jobPosting) {
//if jobPostingData.jobPageId is null or not provided, assign a random crypto.randomBytes(16).toString("hex") string
if (!jobPostingData.jobPageId) {
jobPostingData.jobPageId = crypto.randomBytes(16).toString('hex');
}
const newJobPosting = await Posting.create(jobPostingData);
createdJobPostings.push(newJobPosting);
}
Expand Down

0 comments on commit 6ffe0c6

Please sign in to comment.