-
Notifications
You must be signed in to change notification settings - Fork 456
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* gmaps-dropdown * company-logo-url-fix * workflow-pipeline-prettier-fix * prettier-fix * failure-syntax-fix * ui changes + husky pre-commit * prettier-fix --------- Co-authored-by: Aakash Singh <[email protected]> Co-authored-by: Vineet Agarwal <[email protected]>
- Loading branch information
1 parent
167def8
commit 7673146
Showing
15 changed files
with
159 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
/* eslint-disable no-console */ | ||
import { Currency, Role, WorkMode } from '@prisma/client'; | ||
import { faker } from '@faker-js/faker'; | ||
import bcrypt from 'bcryptjs'; | ||
import prisma from '../src/config/prisma.config'; | ||
import { JobLocations } from '@prisma/client'; | ||
|
||
const users = [ | ||
{ id: '1', name: 'Jack', email: '[email protected]' }, | ||
{ id: '2', name: 'Admin', email: '[email protected]', role: Role.ADMIN }, | ||
]; | ||
|
||
const locationArr = Object.keys(JobLocations); | ||
|
||
let jobs = [ | ||
{ | ||
id: '1', | ||
|
@@ -286,13 +284,6 @@ async function seedUsers() { | |
} | ||
|
||
async function seedJobs() { | ||
jobs = jobs.map((j, index) => { | ||
return { | ||
...j, | ||
location: | ||
locationArr[index] !== undefined ? locationArr[index] : locationArr[3], | ||
}; | ||
}); | ||
try { | ||
await Promise.all( | ||
jobs.map(async (j) => | ||
|
@@ -311,8 +302,8 @@ async function seedJobs() { | |
workMode: j.workMode, | ||
currency: j.currency, | ||
application: j.application, | ||
//@ts-ignore | ||
location: j.location, | ||
city: faker.location.city(), | ||
address: faker.location.streetAddress(), | ||
companyLogo: j.companyLogo, | ||
hasSalaryRange: j.hasSalaryRange, | ||
minSalary: j.minSalary, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import Script from 'next/script'; | ||
import { Input } from './ui/input'; | ||
|
||
export type TgmapsAddress = { city: string; fullAddress: string }; | ||
|
||
export function GmapsAutocompleteAddress({ form }: { form: any }) { | ||
let autocomplete: any = null; | ||
|
||
function onPlaceChanged() { | ||
const { name, formatted_address } = autocomplete.getPlace(); | ||
form.setValue('city', name); | ||
form.setValue('address', formatted_address); | ||
} | ||
|
||
function initializeGmaps() { | ||
if ((window as any).google) { | ||
autocomplete = new (window as any).google.maps.places.Autocomplete( | ||
document.getElementById('autocomplete'), | ||
{ | ||
types: ['(cities)'], | ||
} | ||
); | ||
autocomplete.addListener('place_changed', onPlaceChanged); | ||
} | ||
} | ||
return ( | ||
<> | ||
<Script | ||
src={`https://maps.googleapis.com/maps/api/js?key=${process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY}&libraries=places`} | ||
strategy="lazyOnload" | ||
onLoad={initializeGmaps} | ||
/> | ||
|
||
<Input | ||
id="autocomplete" | ||
type="text" | ||
className="w-full bg-gray-800 border-none text-white" | ||
placeholder="Where is the job located?" | ||
/> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.