Skip to content

Commit 943d500

Browse files
add: link field to /notifications/create (#315)
1 parent bbd0884 commit 943d500

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/plans/components/PlanValidation.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect } from "react";
2-
import { ApiHelper, ArrayHelper, AssignmentInterface, BlockoutDateInterface, DateHelper, DisplayBox, Locale, NotificationInterface, PersonInterface, PlanInterface, PositionInterface, TimeInterface } from "@churchapps/apphelper";
2+
import { ApiHelper, ArrayHelper, AssignmentInterface, BlockoutDateInterface, CommonEnvironmentHelper, DateHelper, DisplayBox, Locale, NotificationInterface, PersonInterface, PlanInterface, PositionInterface, TimeInterface, UserHelper } from "@churchapps/apphelper";
33

44
interface Props {
55
plan: PlanInterface,
@@ -194,7 +194,13 @@ export const PlanValidation = (props: Props) => {
194194
pending.forEach(a => {
195195
const position: PositionInterface = ArrayHelper.getOne(props.positions, "id", a.positionId);
196196
a.notified = new Date();
197-
const data: any = { peopleIds: [a.personId], contentType: "assignment", contentId: props.plan.id, message: Locale.label("plans.planValidation.volReq") + props.plan.name + " - " + position.name + "." + Locale.label("plans.planValidation.pleaseConfirm") };
197+
const data: any = {
198+
peopleIds: [a.personId],
199+
contentType: "assignment",
200+
contentId: props.plan.id,
201+
message: Locale.label("plans.planValidation.volReq") + props.plan.name + " - " + position.name + "." + Locale.label("plans.planValidation.pleaseConfirm"),
202+
link: CommonEnvironmentHelper.B1Root.replace("{key}", UserHelper.currentUserChurch.church.subDomain) + "/my/plans/" + props.plan.id
203+
};
198204
promises.push(ApiHelper.post("/notifications/create", data, "MessagingApi"));
199205
});
200206
promises.push(ApiHelper.post("/assignments", pending, "DoingApi"));

0 commit comments

Comments
 (0)