Resolve "Disable event invitation of all users"
see #69
EventRoute.ts
:
Changes in - async inviteUsers(id: string) {
- const response = await this.request({
- path: `${this.path}${id}/invite_users/`,
- method: 'POST'
- })
- const data = response.data
- return new JSONResponse<APIEnvelope<EventParticipationDto[]>>(
- response,
- data
- )
- }
-
Removed
inviteUsers
Method:- The
inviteUsers
asynchronous method is removed from theEventRoute
class. - Previously, this method performed an API request to invite all users to an event with the event ID
id
.
- The
EventInvitePeople.vue
:
Changes in -function handleInviteAllUsers() {
- $q.dialog({
- title: 'Alle Benutzer*innen einladen',
- message: 'Möchtest du alle Benutzer*innen des Kreisverbandes einladen?',
- cancel: true
- })
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
- .onOk(() => inviteUsers())
-}
-async function inviteUsers() {
- const response = await apiClient.events.inviteUsers(props.eventId.toString())
- const newParticipations = response.payload.data
- if (newParticipations.length > 0) {
- let areUsersAlreadyInvited = true
- for (const participation of response.payload.data) {
- if (!participations.value.find(({ id }) => id === participation.id)) {
- areUsersAlreadyInvited = false
- participations.value.push(participation)
- }
- }
- if (areUsersAlreadyInvited) {
- $q.notify({
- color: 'warning',
- message: 'Es wurden bereits alle Benutzer*innen eingeladen.'
- })
- }
- } else {
- $q.notify({
- color: 'info',
- message:
- 'In dem zugehörigen Kreisverband gibt es keine angemeldeten Benutzer*innen.'
- })
- }
-}
-
Removed
handleInviteAllUsers
andinviteUsers
Functions:- The
handleInviteAllUsers
function, which triggered a dialog to invite all users, andinviteUsers
function, which performed the actual API call to invite users, are removed. - These functions were responsible for handling user invitations to an event directly from the Vue component.
- The associated UI elements and logic in the template (
<div class="row invite-users">...</div>
) that allowed inviting all users are also removed.
- The
Summary:
-
EventRoute.ts:
- The
inviteUsers
method, responsible for inviting users to an event via an API call, is removed.
- The
-
EventInvitePeople.vue:
- The
handleInviteAllUsers
function and theinviteUsers
function, along with associated UI elements for inviting all users, are removed. - This suggests a refactoring or removal of the feature that allowed mass-inviting users from within the Vue component.
- The
These changes indicate a revision or removal of the functionality related to inviting users to events, possibly due to refactoring, feature changes, or updates in the application's requirements.
Edited by control.alt.coop eG (Peter)