Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Cassidy-Boilley committed May 30, 2024
2 parents d28f43e + 34e4988 commit 01701ed
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ To install the project, clone the repository and run `npm install` to install al
^^
This will require admin access to the repository

- Testing is done through Playwright and Jest. Ideally tests should be made with Jest so that coverage can be done. However playwright is easier to use but doesn't currently have coverage reports.
- Testing is done through Playwright and Jest. Unit tests should be made with Jest so that coverage can be done. However playwright is easier to use for end-to-end testing but doesn't currently register on coverage reports.
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
4 changes: 2 additions & 2 deletions src/app/api/job-posting/siteRequestUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const sortTypeMap = {

// Employment sub-type map to filter job postings by employment sub-type
const employmentSubTypeMap = {
ft: 'Full time',
pt: 'Part time',
ft: 'Full Time',
pt: 'Part Time',
};

// Function to get the total number of job postings
Expand Down

0 comments on commit 01701ed

Please sign in to comment.