Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3 - compensations consistent field naming #630

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/compensations/Compensations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ const Compensations = ({ compensations, locations }: CompensationsProps) => {
salariesFromLocation(
currentYear,
selectedLocation,
compensations.salaries,
compensations.salariesByLocation,
),
[currentYear, selectedLocation, compensations.salaries],
[currentYear, selectedLocation, compensations.salariesByLocation],
);

const updateSelectedDegree = (newDegree: Degree) => {
Expand Down
2 changes: 1 addition & 1 deletion studio/lib/payloads/compensations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ export interface CompensationsPage {
pensionPercent?: number;
benefitsByLocation: BenefitsByLocation[];
bonusesByLocation: BonusesByLocationPage[];
salaries: SalariesByLocation[];
salariesByLocation: SalariesByLocation[];
showSalaryCalculator: boolean;
}
4 changes: 2 additions & 2 deletions studio/schemas/documents/compensations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { titleSlug } from "../schemaTypes/slug";
import seo from "../objects/seo";
import { title } from "../fields/text";
import { bonusesByLocation } from "../objects/compensations/bonusesByLocation";
import { pension } from "../objects/compensations/pension";
import { pensionPercent } from "../objects/compensations/pension";
import { benefitsByLocation } from "../objects/compensations/benefitsByLocation";
import { salariesByLocation } from "../objects/compensations/salariesByLocation";

Expand All @@ -29,7 +29,7 @@ const compensations = defineType({
type: "boolean",
initialValue: true,
}),
pension,
pensionPercent,
bonusesByLocation,
benefitsByLocation,
salariesByLocation,
Expand Down
2 changes: 1 addition & 1 deletion studio/schemas/objects/compensations/pension.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineField } from "sanity";

export const pension = defineField({
export const pensionPercent = defineField({
name: "pensionPercent",
title: "Pension Percentage",
type: "number",
Expand Down
2 changes: 1 addition & 1 deletion studio/schemas/objects/compensations/salariesByLocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { SalariesInput } from "../../../components/salariesInput/SalariesInput";
import { SalariesPage } from "../../../lib/payloads/compensations";

export const salariesByLocation = defineField({
name: "salaries",
name: "salariesByLocation",
title: "Salaries by Location",
description:
"Yearly salary data specific to a particular location. Each location should have a unique entry with the yearly salaries for that location.",
Expand Down