Skip to content
Snippets Groups Projects
Commit 507f3364 authored by Michael Tobis's avatar Michael Tobis
Browse files

updated job applied to table

parent c8aafd7f
No related branches found
No related tags found
No related merge requests found
# Generated by Django 3.2.11 on 2023-01-31 00:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0004_jobsappliedto_user'),
]
operations = [
migrations.RemoveField(
model_name='jobsappliedto',
name='applied_on',
),
migrations.RemoveField(
model_name='jobsappliedto',
name='posting_id',
),
migrations.AddField(
model_name='jobsappliedto',
name='employer_website',
field=models.CharField(blank=True, max_length=2000, null=True),
),
migrations.AddField(
model_name='jobsappliedto',
name='job_city',
field=models.CharField(blank=True, max_length=2000, null=True),
),
migrations.AddField(
model_name='jobsappliedto',
name='job_country',
field=models.CharField(blank=True, max_length=2000, null=True),
),
migrations.AddField(
model_name='jobsappliedto',
name='job_employment_type',
field=models.CharField(blank=True, max_length=2000, null=True),
),
migrations.AddField(
model_name='jobsappliedto',
name='job_id',
field=models.CharField(blank=True, max_length=2000, null=True, unique=True),
),
migrations.AddField(
model_name='jobsappliedto',
name='job_is_remote',
field=models.BooleanField(blank=True, null=True),
),
migrations.AddField(
model_name='jobsappliedto',
name='job_max_salary',
field=models.IntegerField(blank=True, null=True),
),
migrations.AddField(
model_name='jobsappliedto',
name='job_min_salary',
field=models.IntegerField(blank=True, null=True),
),
migrations.AddField(
model_name='jobsappliedto',
name='job_posted_at_datetime_utc',
field=models.CharField(blank=True, max_length=2000, null=True),
),
migrations.AddField(
model_name='jobsappliedto',
name='job_publisher',
field=models.CharField(blank=True, max_length=2000, null=True),
),
migrations.AddField(
model_name='jobsappliedto',
name='job_state',
field=models.CharField(blank=True, max_length=2000, null=True),
),
migrations.AddField(
model_name='jobsappliedto',
name='receivedInterview',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='jobsappliedto',
name='receivedOffer',
field=models.BooleanField(default=False),
),
migrations.AlterField(
model_name='jobsappliedto',
name='employer_logo',
field=models.CharField(blank=True, max_length=2000, null=True),
),
migrations.AlterField(
model_name='jobsappliedto',
name='employer_name',
field=models.CharField(max_length=2000),
),
migrations.AlterField(
model_name='jobsappliedto',
name='job_apply_link',
field=models.CharField(blank=True, max_length=2000, null=True),
),
migrations.AlterField(
model_name='jobsappliedto',
name='job_title',
field=models.CharField(blank=True, max_length=2000, null=True),
),
]
......@@ -68,9 +68,20 @@ class User(AbstractBaseUser):
class JobsAppliedTo(models.Model):
user = models.ForeignKey("User", on_delete=models.CASCADE)
posting_id = models.CharField(unique=True, max_length=500)
employer_logo = models.CharField(max_length=500, null=True, blank=True)
employer_name = models.CharField(max_length=500)
job_apply_link = models.CharField(max_length=500)
job_title = models.CharField(max_length=500)
applied_on = models.DateTimeField(auto_now_add=True)
employer_name = models.CharField(max_length=2000)
employer_logo = models.CharField(max_length=2000, null=True, blank=True)
employer_website = models.CharField(max_length=2000, null=True, blank=True)
job_publisher = models.CharField(max_length=2000, null=True, blank=True)
job_id = models.CharField(max_length=2000, null=True, blank=True, unique=True)
job_employment_type = models.CharField(max_length=2000, null=True, blank=True)
job_title = models.CharField(max_length=2000, null=True, blank=True)
job_apply_link = models.CharField(max_length=2000, null=True, blank=True)
job_is_remote = models.BooleanField(null=True, blank=True)
job_posted_at_datetime_utc = models.CharField(max_length=2000, null=True, blank=True)
job_city = models.CharField(max_length=2000, null=True, blank=True)
job_state = models.CharField(max_length=2000, null=True, blank=True)
job_country = models.CharField(max_length=2000, null=True, blank=True)
job_min_salary = models.IntegerField(null=True, blank=True)
job_max_salary = models.IntegerField(null=True, blank=True)
receivedInterview = models.BooleanField(default=False)
receivedOffer = models.BooleanField(default=False)
......@@ -36,16 +36,11 @@ export const getJobsAppliedTo = async () => {
export const markJob = async (post, user) => {
let response = "";
let body = post
body['user'] = user.id
try {
response = await axios.post(`${backend_url}/jobs-applied-to/`, {
user: user.id,
posting_id: post.job_id,
employer_logo: post.employer_logo,
employer_name: post.employer_name,
job_apply_link: post.job_apply_link,
job_title: post.job_title
});
response = await axios.post(`${backend_url}/jobs-applied-to/`, body);
} catch (err) {
response = err.response
}
......
......@@ -50,7 +50,7 @@ export default function PostPopUp({ post }) {
if (response.status && response.status === 201) {
alert("Job successfully saved")
} else if (response.data && response.data.posting_id && response.data.posting_id[0] === "jobs applied to with this posting id already exists.") {
} else if (response.data && response.data.job_id && response.data.job_id[0] === "jobs applied to with this posting id already exists.") {
alert("Error: Job has already been marked")
} else {
console.log(response)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment