Skip to content

Commit

Permalink
Remove name from job
Browse files Browse the repository at this point in the history
  • Loading branch information
pazernykormoran committed Sep 8, 2024
1 parent 8180cf8 commit c9fa2e3
Show file tree
Hide file tree
Showing 9 changed files with 179 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/nextjs/app/employee/offers/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const JobDetails = ({ params }: { params: { slug: string} }) => {
<>
<BackButton href="/employee/offers" />
<div className="flex flex-col gap-10">
<JobBox key={data?.job.name} employer={data.employer} job={data.job} hideArrow />
<JobBox key={data?.job.employer + data.job.arrayIndex} employer={data.employer} job={data.job} hideArrow />
<div>
{paragraphs.map((paragraph, index) => (
<Fragment key={index}>
Expand Down
9 changes: 4 additions & 5 deletions packages/nextjs/app/register/employee/info/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ import { addEmployee } from "~~/db/employeeActions";

const EmployeeInfo: NextPage = () => {
const searchParams = useSearchParams()
console.log(searchParams)
const address = searchParams.get('address')
const merkle_root = searchParams.get('merkle_root')
const nullifier_hash = searchParams.get('nullifier_hash')
const proof = searchParams.get('proof')
const address = searchParams?.get('address')
const merkle_root = searchParams?.get('merkle_root')
const nullifier_hash = searchParams?.get('nullifier_hash')
const proof = searchParams?.get('proof')
const { writeContractAsync: writeYourContractAsync } = useScaffoldWriteContract('WorldWork')
const router = useRouter()

Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/components/job/EmployeeOffers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function EmployeeOffers({ data, isLoading }: Props) {
<div className="flex flex-col gap-3">
{data?.map((job) => (
<JobBoxLink
key={job.job.name}
key={job.job.employer + job.job.arrayIndex}
job={job.job}
employer={job.employer}
href={`/employee/offers/${job.job.employer}?index=${job.job.arrayIndex}`}
Expand Down
6 changes: 4 additions & 2 deletions packages/nextjs/components/job/EmployeeOffersMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ function CurrentOffer({
const [expand, setExpand] = useState(false)
if (!job) return <Loader />

const { name, position, location, stablecoinSalary, tokenSalary, description } = job.job
const { position, location, stablecoinSalary, tokenSalary, description } = job.job

const name = job.employer?.name

const className = expand ? 'translate-y-[-8rem]' : ''

Expand All @@ -65,7 +67,7 @@ function CurrentOffer({
className={`bg-white border border-[#FF32D2] rounded-3xl p-8 text-xl relative ${className}`}
>
<div className="flex gap-6 items-center mb-6">
<Image alt="avatar" src={companies[name]} width={60} height={60} />
{name && <Image alt="avatar" src={companies[name]} width={60} height={60} />}
<div className="font-bold text-xxl text-black">{name}</div>
</div>
<div>{position}</div>
Expand Down
1 change: 0 additions & 1 deletion packages/nextjs/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export const job = pgTable('job', {
employer: text('employer').notNull(),
employee: text('worker'),
arrayIndex: integer('arrayIndex').notNull(),
name: text('name').notNull().default(''),
description: text('description').notNull(),
startDate: date('startDate'),
endDate: date('endDate'),
Expand Down
1 change: 1 addition & 0 deletions packages/nextjs/migrations/0009_tiresome_the_order.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "job" DROP COLUMN IF EXISTS "name";
159 changes: 159 additions & 0 deletions packages/nextjs/migrations/meta/0009_snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
{
"id": "4676f448-b260-45f0-82c6-5b48cf19c98a",
"prevId": "1511d663-493c-4fde-b130-9f6c05fa88bd",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.employee": {
"name": "employee",
"schema": "",
"columns": {
"wallet": {
"name": "wallet",
"type": "text",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"public.employer": {
"name": "employer",
"schema": "",
"columns": {
"wallet": {
"name": "wallet",
"type": "text",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"public.job": {
"name": "job",
"schema": "",
"columns": {
"employer": {
"name": "employer",
"type": "text",
"primaryKey": false,
"notNull": true
},
"worker": {
"name": "worker",
"type": "text",
"primaryKey": false,
"notNull": false
},
"arrayIndex": {
"name": "arrayIndex",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": true
},
"startDate": {
"name": "startDate",
"type": "date",
"primaryKey": false,
"notNull": false
},
"endDate": {
"name": "endDate",
"type": "date",
"primaryKey": false,
"notNull": false
},
"location": {
"name": "location",
"type": "text",
"primaryKey": false,
"notNull": false
},
"position": {
"name": "position",
"type": "text",
"primaryKey": false,
"notNull": false
},
"stablecoinSalary": {
"name": "stablecoinSalary",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"tokenSalary": {
"name": "tokenSalary",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"signed": {
"name": "signed",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"referenceDescription": {
"name": "referenceDescription",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {
"job_employer_arrayIndex_pk": {
"name": "job_employer_arrayIndex_pk",
"columns": [
"employer",
"arrayIndex"
]
}
},
"uniqueConstraints": {}
}
},
"enums": {},
"schemas": {},
"sequences": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
7 changes: 7 additions & 0 deletions packages/nextjs/migrations/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@
"when": 1725754880993,
"tag": "0008_slimy_tomas",
"breakpoints": true
},
{
"idx": 9,
"version": "7",
"when": 1725756083486,
"tag": "0009_tiresome_the_order",
"breakpoints": true
}
]
}
3 changes: 2 additions & 1 deletion packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"vercel": "vercel",
"vercel:yolo": "vercel --build-env NEXT_PUBLIC_IGNORE_BUILD_ERROR=true",
"db:migration:generate": "drizzle-kit generate",
"db:migration:push": "npx drizzle-kit migrate"
"db:migration:push": "npx drizzle-kit migrate",
"tsc": "tsc"
},
"dependencies": {
"@ensdomains/ensjs": "4.0.0",
Expand Down

0 comments on commit c9fa2e3

Please sign in to comment.