]> git.agnieray.net Git - galette.git/blob - galette/includes/routes/ajax.routes.php
1aa806cf0adfc29afdb339811bd700a615a3fa12
[galette.git] / galette / includes / routes / ajax.routes.php
1 <?php
2
3 /**
4 * Copyright © 2003-2024 The Galette Team
5 *
6 * This file is part of Galette (https://galette.eu).
7 *
8 * Galette is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * Galette is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 use Galette\Controllers\AjaxController;
23 use Galette\Entity\Adherent;
24 use Galette\Entity\Contribution;
25 use Galette\Entity\ContributionsTypes;
26 use Galette\Repository\Members;
27 use Galette\Filters\MembersList;
28 use Slim\Routing\RouteCollectorProxy;
29
30 $app->group('/ajax', function (RouteCollectorProxy $app) use ($authenticate) {
31 $app->get(
32 '/messages',
33 [AjaxController::class, 'messages']
34 )->setName('ajaxMessages');
35
36 $app->post(
37 'photo',
38 [AjaxController::class, 'photo']
39 )->setName('photoDnd');
40
41 $app->post(
42 '/suggest/towns/{term}',
43 [AjaxController::class, 'suggestTowns']
44 )->setName('suggestTown');
45
46 $app->post(
47 '/suggest/countries/{term}',
48 [AjaxController::class, 'suggestCountries']
49 )->setName('suggestCountry');
50
51 $app->post(
52 '/suggest/regions/{term}',
53 [AjaxController::class, 'suggestRegions']
54 )->setName('suggestRegion');
55
56 $app->get(
57 '/telemetry/infos',
58 [AjaxController::class, 'telemetryInfos']
59 )->setName('telemetryInfos')->add($authenticate);
60
61 $app->post(
62 '/telemetry/send',
63 [AjaxController::class, 'telemetrySend']
64 )->setName('telemetrySend')->add($authenticate);
65
66 $app->get(
67 '/telemetry/registered',
68 [AjaxController::class, 'telemetryRegistered']
69 )->setName('setRegistered')->add($authenticate);
70
71 $app->post(
72 '/contribution/dates',
73 [AjaxController::class, 'contributionDates']
74 )->setName('contributionDates')->add($authenticate);
75
76 $app->post(
77 '/contribution/members[/{page:\d+}[/{search}]]',
78 [AjaxController::class, 'contributionMembers']
79 )->setName('contributionMembers')->add($authenticate);
80
81 $app->post(
82 '/password/strength',
83 [AjaxController::class, 'passwordStrength']
84 )->setName('checkPassword');
85 });