Skip to content

Commit 377ffc3

Browse files
committed
fix(opportunity): salary validation to be based of max salary
1 parent 847607b commit 377ffc3

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/common/schema/opportunities.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,13 @@ export const opportunityEditSchema = z
190190
.refine(
191191
(data) => {
192192
if (data?.min && data?.max) {
193-
return data.max >= data.min && data.max <= data.min * 1.25;
193+
return data.max >= data.min && data.min >= data.max * 0.75;
194194
}
195195

196196
return true;
197197
},
198198
{
199-
error:
200-
'Min salary must be less than or equal to max salary and no more than 25% lower',
199+
error: 'Salary range must be within 25% of maximum salary',
201200
},
202201
),
203202
seniorityLevel: z.number(),

0 commit comments

Comments
 (0)