Skip to content

Commit

Permalink
Rename holdRequestSource to formattedSourceForHoldRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
dgcohen committed Dec 20, 2024
1 parent 9ad3b79 commit 2b29f54
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pages/hold/request/[id]/edd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default function EDDRequestPage({
const [eddFormState, setEddFormState] = useState({
...initialEDDFormState,
patronId,
source: item.holdRequestSource,
source: item.formattedSourceForHoldRequest,
})
const [formPosting, setFormPosting] = useState(false)

Expand Down
2 changes: 1 addition & 1 deletion pages/hold/request/[id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export default function HoldRequestPage({
handleSubmit={handleSubmit}
holdId={holdId}
patronId={patronId}
source={item.holdRequestSource}
source={item.formattedSourceForHoldRequest}
/>
</>
) : null}
Expand Down
2 changes: 1 addition & 1 deletion src/models/Item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default class Item {
.includes("all")
}

get holdRequestSource(): string {
get formattedSourceForHoldRequest(): string {
return convertCamelToShishKabobCase(this.source)
}

Expand Down
2 changes: 1 addition & 1 deletion src/models/modelTests/Item.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe("Item model", () => {
})

it("returns the source in kebabcase for use in hold requests", () => {
expect(item.holdRequestSource).toBe("sierra-nypl")
expect(item.formattedSourceForHoldRequest).toBe("sierra-nypl")
})
})

Expand Down

0 comments on commit 2b29f54

Please sign in to comment.