Skip to content

Commit

Permalink
Minor fixes PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
CaitBarnard committed Dec 17, 2024
1 parent 8d30fad commit b4cb1a0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
12 changes: 7 additions & 5 deletions front_end/src/Components/EditPayroll/EditPayModifier/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { monthsToTitleCase } from "../../../Util";

const EditPayModifier = ({ data, onInputChange }) => {
return (
data.length > 0 && (
<div className="govuk-form-group">
data.length > 0 &&
data.map((row, index) => (
<div className="govuk-form-group" key={index}>
{console.log(row)}
<table className="govuk-table">
<thead className="govuk-table__head">
<tr className="govuk-table__row">
Expand All @@ -18,7 +20,7 @@ const EditPayModifier = ({ data, onInputChange }) => {
</thead>
<tbody className="govuk-table__body">
<tr className="govuk-table__row">
{data[0].pay_modifiers.map((value, index) => {
{row.pay_modifiers.map((value, index) => {
return (
<td className="govuk-table__cell" key={index}>
<input
Expand All @@ -28,7 +30,7 @@ const EditPayModifier = ({ data, onInputChange }) => {
type="number"
defaultValue={value}
onChange={(e) =>
onInputChange(data[0].id, index, e.target.value)
onInputChange(row.id, index, e.target.value)
}
></input>
</td>
Expand All @@ -38,7 +40,7 @@ const EditPayModifier = ({ data, onInputChange }) => {
</tbody>
</table>
</div>
)
))
);
};

Expand Down
4 changes: 2 additions & 2 deletions front_end/src/Components/EditPayroll/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ export function getPayModifierData() {
/**
* Post modified pay modifiers data.
*
* @param {types.PayModifierData[]} payModifierData - Vacancy data to be sent.
* @returns {import("../../Util").PostDataResponse} Updated vacancy data received.
* @param {types.PayModifierData[]} payModifierData - Pay modifier data to be sent.
* @returns {import("../../Util").PostDataResponse} Updated pay modifier data received.
*/
export function postPayModifierData(payModifierData) {
return postData(
Expand Down
2 changes: 1 addition & 1 deletion front_end/src/Components/EditPayroll/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

/**
* @typedef {Object} PayModifierData
* @property {string} id - The pay modifier's pk.
* @property {number} id - The pay modifier's pk.
* @property {float[]} pay_modifiers - The pay modifier's monthly percentages
*/

Expand Down

0 comments on commit b4cb1a0

Please sign in to comment.