Skip to content

Commit

Permalink
improve: show all funds for payment question
Browse files Browse the repository at this point in the history
  • Loading branch information
Himali-Malvawala committed Sep 25, 2024
1 parent c30e50d commit a2d9f5c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/forms/components/PaymentEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@ export const PaymentEdit: React.FC<Props> = (props) => {

React.useEffect(() => {
ApiHelper.get("/funds", "GivingApi").then((data: any) => {
const result = ArrayHelper.getAll(data, "taxDeductible", false);
setFunds(result);
if (fundId === "" && result.length > 0) {
setFundId(result[0].id);
setFunds(data);
if (fundId === "" && data.length > 0) {
setFundId(data[0].id);
let q = { ...props.question };
if (!q.choices) {
q.choices = [{ value: result[0].id, text: "FundId" }];
q.choices = [{ value: data[0].id, text: "FundId" }];
q.choices.push({ value: "0", text: "Amount" });
}
props.updatedFunction(q)
Expand Down

0 comments on commit a2d9f5c

Please sign in to comment.