@churchapps/apphelper 0.2.18 → 0.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChurchList.d.ts","sourceRoot":"","sources":["../../../src/components/wrapper/ChurchList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"ChurchList.d.ts","sourceRoot":"","sources":["../../../src/components/wrapper/ChurchList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAe,MAAM,qBAAqB,CAAC;AAKlG,MAAM,WAAW,KAAK;IAAG,YAAY,EAAE,wBAAwB,EAAE,CAAC;IAAC,iBAAiB,EAAE,wBAAwB,CAAC;IAAC,OAAO,EAAE,oBAAoB,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE;AAEtK,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAsCtC,CAAC"}
|
|
@@ -26,13 +26,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.ChurchList = void 0;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
28
|
const helpers_1 = require("@churchapps/helpers");
|
|
29
|
+
const ApiHelper_1 = require("../../helpers/ApiHelper");
|
|
29
30
|
const UserHelper_1 = require("../../helpers/UserHelper");
|
|
30
31
|
const NavItem_1 = require("./NavItem");
|
|
31
32
|
const ChurchList = props => {
|
|
32
33
|
const [userChurches, setUserChurches] = (0, react_1.useState)(UserHelper_1.UserHelper.userChurches.filter(uc => uc.apis.length > 0 && uc.person.id !== null));
|
|
33
34
|
const handleDelete = (uc) => {
|
|
34
35
|
if (window.confirm(`Are you sure you wish to delete ${(uc.church.name).toUpperCase()} church from the list?`)) {
|
|
35
|
-
|
|
36
|
+
ApiHelper_1.ApiHelper.delete(`/userchurch/record/${props.context.user.id}/${uc.church.id}/${uc.person.id}`, "MembershipApi")
|
|
36
37
|
.then(() => {
|
|
37
38
|
// remove the same from userChurches
|
|
38
39
|
const idx = helpers_1.ArrayHelper.getIndex(UserHelper_1.UserHelper.userChurches, "church.id", uc.church.id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChurchList.js","sourceRoot":"","sources":["../../../src/components/wrapper/ChurchList.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"ChurchList.js","sourceRoot":"","sources":["../../../src/components/wrapper/ChurchList.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAwC;AACxC,iDAAkG;AAClG,uDAAoD;AACpD,yDAAsD;AACtD,uCAAoC;AAI7B,MAAM,UAAU,GAAoB,KAAK,CAAC,EAAE;IACjD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAC,uBAAU,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;IAEpI,MAAM,YAAY,GAAG,CAAC,EAA4B,EAAE,EAAE;QACpD,IAAI,MAAM,CAAC,OAAO,CAAC,mCAAmC,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,wBAAwB,CAAC,EAAE;YAC7G,qBAAS,CAAC,MAAM,CAAC,sBAAsB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE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MAAM,CAAC,EAAE,EACzB,QAAQ,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,IAAI,EACtE,OAAO,EAAE,GAAG,EAAE,CAAC,uBAAU,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,EACjF,KAAK,EAAE,UAAU,EACjB,IAAI,EAAC,QAAQ,EACb,UAAU,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAChF,WAAW,EAAC,6BAA6B,EACzC,cAAc,EAAE,GAAG,EAAE,GAAG,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAC3C,CAAC,CAAC;QACN,CAAC,CAAC,CAAC;QAEH,OAAO,8DAAG,MAAM,CAAI,CAAC;KACtB;AACH,CAAC,CAAC;AAtCW,QAAA,UAAU,cAsCrB"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import { LoginUserChurchInterface, UserContextInterface,
|
|
2
|
+
import { LoginUserChurchInterface, UserContextInterface, ArrayHelper } from "@churchapps/helpers";
|
|
3
|
+
import { ApiHelper } from "../../helpers/ApiHelper";
|
|
3
4
|
import { UserHelper } from "../../helpers/UserHelper";
|
|
4
5
|
import { NavItem } from "./NavItem";
|
|
5
6
|
|