Skip to content

Resolve "Disable event invitation of all users"

see #69

Changes in EventRoute.ts:

-  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 the EventRoute class.
    • Previously, this method performed an API request to invite all users to an event with the event ID id.

Changes in EventInvitePeople.vue:

-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 and inviteUsers Functions:
    • The handleInviteAllUsers function, which triggered a dialog to invite all users, and inviteUsers 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.

Summary:

  • EventRoute.ts:

    • The inviteUsers method, responsible for inviting users to an event via an API call, is removed.
  • EventInvitePeople.vue:

    • The handleInviteAllUsers function and the inviteUsers 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.

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)

Merge request reports

Loading