PageSourceSearch

https://www.renfrewshiregolfunion.co.uk/controls-vue/services/menu-service.js?v=1c09ac6248

js renfrewshiregolfunion.co.uk collected 2026-09-27 15:21:43 UTC 13,959 bytes, 287 lines download raw bytes

1/// <reference path="./base-service.ts" />
2var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4    return new (P || (P = Promise))(function (resolve, reject) {
5        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8        step((generator = generator.apply(thisArg, _arguments || [])).next());
9    });
10};
11var __generator = (this && this.__generator) || function (thisArg, body) {
12    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13    return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14    function verb(n) { return function (v) { return step([n, v]); }; }
15    function step(op) {
16        if (f) throw new TypeError("Generator is already executing.");
17        while (g && (g = 0, op[0] && (_ = 0)), _) try {
18            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19            if (y = 0, t) op = [op[0] & 2, t.value];
20            switch (op[0]) {
21                case 0: case 1: t = op; break;
22                case 4: _.label++; return { value: op[1], done: false };
23                case 5: _.label++; y = op[1]; op = [0]; continue;
24                case 7: op = _.ops.pop(); _.trys.pop(); continue;
25                default:
26                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30                    if (t[2]) _.ops.pop();
31                    _.trys.pop(); continue;
32            }
33            op = body.call(thisArg, _);
34        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36    }
37};
38//NOTE: Always CTRL F5 to clear the browser cache
39var AppServices;
40(function (AppServices) {
41    var MenuService = /** @class */ (function () {
42        function MenuService() {
43            this.baseUrl = '/api/Menu/';
44            this._api = null;
45            this._api = new BaseService.ApiService();
46        }
47        //Use GetMenuByGroup() instead.
48        MenuService.prototype.GetFooterMenu = function (clubWebsiteId) {
49            return __awaiter(this, void 0, void 0, function () {
50                var url, result, error_1;
51                return __generator(this, function (_a) {
52                    switch (_a.label) {
53                        case 0:
54                            url = this.baseUrl + "GetFooterMenu";
55                            _a.label = 1;
56                        case 1:
57                            _a.trys.push([1, 3, , 4]);
58                            return [4 /*yield*/, this._api.post(url, {
59                                    clubWebsiteId: clubWebsiteId
60                                })];
61                        case 2:
62                            result = _a.sent();
63                            return [2 /*return*/, result.data];
64                        case 3:
65                            error_1 = _a.sent();
66                            return [2 /*return*/, {
67                                    successful: false,
68                                    errorMessage: error_1.response,
69                                }];
70                        case 4: return [2 /*return*/];
71                    }
72                });
73            });
74        };
75        MenuService.prototype.GetMenuByGroup = function (clubWebsiteId, menuGroup, excludeRoot) {
76            return __awaiter(this, void 0, void 0, function () {
77                var url, result, error_2;
78                return __generator(this, function (_a) {
79                    switch (_a.label) {
80                        case 0:
81                            url = this.baseUrl + "GetMenuByGroup";
82                            _a.label = 1;
83                        case 1:
84                            _a.trys.push([1, 3, , 4]);
85                            return [4 /*yield*/, this._api.post(url, {
86                                    clubWebsiteId: clubWebsiteId,
87                                    menuGroup: menuGroup,
88                                    excludeRoot: excludeRoot,
89                                })];
90                        case 2:
91                            result = _a.sent();
92                            return [2 /*return*/, result.data];
93                        case 3:
94                            error_2 = _a.sent();
95                            return [2 /*return*/, {
96                                    successful: false,
97                                    errorMessage: error_2.response,
98                                }];
99                        case 4: return [2 /*return*/];
100                    }
101                });
102            });
103        };
104        MenuService.prototype.GetMenuGroups = function (clubWebsiteId) {
105            return __awaiter(this, void 0, void 0, function () {
106                var url, result, error_3;
107                return __generator(this, function (_a) {
108                    switch (_a.label) {
109                        case 0:
110                            url = this.baseUrl + "GetMenuGroups";
111                            _a.label = 1;
112                        case 1:
113                            _a.trys.push([1, 3, , 4]);
114                            return [4 /*yield*/, this._api.post(url, {
115                                    clubWebsiteId: clubWebsiteId,
116                                })];
117                        case 2:
118                            result = _a.sent();
119                            return [2 /*return*/, result.data];
120                        case 3:
121                            error_3 = _a.sent();
122                            return [2 /*return*/, {
123                                    successful: false,
124                                    errorMessage: error_3.response,
125                                }];
126                        case 4: return [2 /*return*/];
127                    }
128                });
129            });
130        };
131        //Use GetMenuByGroup() instead.
132        MenuService.prototype.GetMenu = function (clubWebsiteId) {
133            return __awaiter(this, void 0, void 0, function () {
134                var url, result, error_4;
135                return __generator(this, function (_a) {
136                    switch (_a.label) {
137                        case 0:
138                            url = this.baseUrl + "GetMenu";
139                            _a.label = 1;
140                        case 1:
141                            _a.trys.push([1, 3, , 4]);
142                            return [4 /*yield*/, this._api.post(url, {
143                                    clubWebsiteId: clubWebsiteId
144                                })];
145                        case 2:
146                            result = _a.sent();
147                            return [2 /*return*/, result.data];
148                        case 3:
149                            error_4 = _a.sent();
150                            return [2 /*return*/, {
151                                    successful: false,
152                                    errorMessage: error_4.response,
153                                }];
154                        case 4: return [2 /*return*/];
155                    }
156                });
157            });
158        };
159        MenuService.prototype.UpdateSettings = function (payload) {
160            return __awaiter(this, void 0, void 0, function () {
161                var url, result, error_5;
162                return __generator(this, function (_a) {
163                    switch (_a.label) {
164                        case 0:
165                            url = this.baseUrl + "UpdateSettings";
166                            _a.label = 1;
167                        case 1:
168                            _a.trys.push([1, 3, , 4]);
169                            return [4 /*yield*/, this._api.post(url, payload)];
170                        case 2:
171                            result = _a.sent();
172                            return [2 /*return*/, result.data];
173                        case 3:
174                            error_5 = _a.sent();
175                            return [2 /*return*/, {
176                                    successful: false,
177                                    errorMessage: error_5.response,
178                                }];
179                        case 4: return [2 /*return*/];
180                    }
181                });
182            });
183        };
184        MenuService.prototype.GetBreadcrumbMenu = function (pageId) {
185            return __awaiter(this, void 0, void 0, function () {
186                var url, result, error_6;
187                return __generator(this, function (_a) {
188                    switch (_a.label) {
189                        case 0:
190                            url = "".concat(this.baseUrl, "GetBreadcrumbs?pageId=").concat(pageId);
191                            _a.label = 1;
192                        case 1:
193                            _a.trys.push([1, 3, , 4]);
194                            return [4 /*yield*/, this._api.get(url)];
195                        case 2:
196                            result = _a.sent();
197                            return [2 /*return*/, result.data];
198                        case 3:
199                            error_6 = _a.sent();
200                            return [2 /*return*/, {
201                                    successful: false,
202                                    errorMessage: error_6.response,
203                                }];
204                        case 4: return [2 /*return*/];
205                    }
206                });
207            });
208        };
209        MenuService.prototype.UpsertMenuItem = function (payload) {
210            return __awaiter(this, void 0, void 0, function () {
211                var url, result, error_7;
212                return __generator(this, function (_a) {
213                    switch (_a.label) {
214                        case 0:
215                            url = this.baseUrl + "UpsertMenuItem";
216                            _a.label = 1;
217                        case 1:
218                            _a.trys.push([1, 3, , 4]);
219                            return [4 /*yield*/, this._api.post(url, payload)];
220                        case 2:
221                            result = _a.sent();
222                            return [2 /*return*/, result.data];
223                        case 3:
224                            error_7 = _a.sent();
225                            return [2 /*return*/, {
226                                    successful: false,
227                                    errorMessage: error_7.response,
228                                }];
229                        case 4: return [2 /*return*/];
230                    }
231                });
232            });
233        };
234        MenuService.prototype.DeleteMenuItem = function (payload) {
235            return __awaiter(this, void 0, void 0, function () {
236                var url, result, error_8;
237                return __generator(this, function (_a) {
238                    switch (_a.label) {
239                        case 0:
240                            url = this.baseUrl + "DeleteMenuItem";
241                            _a.label = 1;
242                        case 1:
243                            _a.trys.push([1, 3, , 4]);
244                            return [4 /*yield*/, this._api.post(url, payload)];
245                        case 2:
246                            result = _a.sent();
247                            return [2 /*return*/, result.data];
248                        case 3:
249                            error_8 = _a.sent();
250                            return [2 /*return*/, {
251                                    successful: false,
252                                    errorMessage: error_8.response,
253                                }];
254                        case 4: return [2 /*return*/];
255                    }
256                });
257            });
258        };
259        MenuService.prototype.UpdateMenuPriority = function (payload) {
260            return __awaiter(this, void 0, void 0, function () {
261                var url, result, error_9;
262                return __generator(this, function (_a) {
263                    switch (_a.label) {
264                        case 0:
265                            url = this.baseUrl + "UpdateMenuPriority";
266                            _a.label = 1;
267                        case 1:
268                            _a.trys.push([1, 3, , 4]);
269                            return [4 /*yield*/, this._api.post(url, payload)];
270                        case 2:
271                            result = _a.sent();
272                            return [2 /*return*/, result.data];
273                        case 3:
274                            error_9 = _a.sent();
275                            return [2 /*return*/, {
276                                    successful: false,
277                                    errorMessage: error_9.response,
278                                }];
279                        case 4: return [2 /*return*/];
280                    }
281                });
282            });
283        };
284        return MenuService;
285    }());
286    AppServices.MenuService = MenuService;
287})(AppServices || (AppServices = {}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.