mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2025-07-28 04:33:42 +08:00
[offers][fix] remove compulsory tc and monthly salary for past exp
This commit is contained in:
@ -754,11 +754,9 @@ export const offersProfileRouter = createRouter()
|
||||
}
|
||||
} else if (!exp.id) {
|
||||
// Create new experience
|
||||
if (
|
||||
exp.jobType === JobType.FULLTIME &&
|
||||
exp.totalCompensation?.currency != null &&
|
||||
exp.totalCompensation?.value != null
|
||||
) {
|
||||
if (exp.jobType === JobType.FULLTIME) {
|
||||
if (exp.totalCompensation?.currency != null &&
|
||||
exp.totalCompensation?.value != null) {
|
||||
if (exp.companyId) {
|
||||
await ctx.prisma.offersBackground.update({
|
||||
data: {
|
||||
@ -825,11 +823,51 @@ export const offersProfileRouter = createRouter()
|
||||
},
|
||||
});
|
||||
}
|
||||
} else if (
|
||||
exp.jobType === JobType.INTERN &&
|
||||
exp.monthlySalary?.currency != null &&
|
||||
exp.monthlySalary?.value != null
|
||||
) {
|
||||
} else if (exp.companyId) {
|
||||
await ctx.prisma.offersBackground.update({
|
||||
data: {
|
||||
experiences: {
|
||||
create: {
|
||||
company: {
|
||||
connect: {
|
||||
id: exp.companyId,
|
||||
},
|
||||
},
|
||||
durationInMonths: exp.durationInMonths,
|
||||
jobType: exp.jobType,
|
||||
level: exp.level,
|
||||
location: exp.location,
|
||||
specialization: exp.specialization,
|
||||
title: exp.title,
|
||||
},
|
||||
},
|
||||
},
|
||||
where: {
|
||||
id: input.background.id,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
await ctx.prisma.offersBackground.update({
|
||||
data: {
|
||||
experiences: {
|
||||
create: {
|
||||
durationInMonths: exp.durationInMonths,
|
||||
jobType: exp.jobType,
|
||||
level: exp.level,
|
||||
location: exp.location,
|
||||
specialization: exp.specialization,
|
||||
title: exp.title,
|
||||
},
|
||||
},
|
||||
},
|
||||
where: {
|
||||
id: input.background.id,
|
||||
},
|
||||
});
|
||||
}
|
||||
} else if (exp.jobType === JobType.INTERN) {
|
||||
if (exp.monthlySalary?.currency != null &&
|
||||
exp.monthlySalary?.value != null) {
|
||||
if (exp.companyId) {
|
||||
await ctx.prisma.offersBackground.update({
|
||||
data: {
|
||||
@ -894,6 +932,46 @@ export const offersProfileRouter = createRouter()
|
||||
},
|
||||
});
|
||||
}
|
||||
} else if (exp.companyId) {
|
||||
await ctx.prisma.offersBackground.update({
|
||||
data: {
|
||||
experiences: {
|
||||
create: {
|
||||
company: {
|
||||
connect: {
|
||||
id: exp.companyId,
|
||||
},
|
||||
},
|
||||
durationInMonths: exp.durationInMonths,
|
||||
jobType: exp.jobType,
|
||||
location: exp.location,
|
||||
specialization: exp.specialization,
|
||||
title: exp.title,
|
||||
},
|
||||
},
|
||||
},
|
||||
where: {
|
||||
id: input.background.id,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
await ctx.prisma.offersBackground.update({
|
||||
data: {
|
||||
experiences: {
|
||||
create: {
|
||||
durationInMonths: exp.durationInMonths,
|
||||
jobType: exp.jobType,
|
||||
location: exp.location,
|
||||
specialization: exp.specialization,
|
||||
title: exp.title,
|
||||
},
|
||||
},
|
||||
},
|
||||
where: {
|
||||
id: input.background.id,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user